FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
stacktrace/example/trace_addresses.cpp at develop · hktkdmp/stacktrace · GitHub
hktkdmp
/
stacktrace
Public
forked from
boostorg/stacktrace
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
stacktrace
/
example
/
trace_addresses.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (49 loc) · 1.41 KB
Breadcrumbs
stacktrace
/
example
/
trace_addresses.cpp
Copy path
File metadata and controls
63 lines (49 loc) · 1.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
Copyright Antony Polukhin, 2016-2021.
//
//
Distributed under the Boost Software License, Version 1.0. (See
//
accompanying file LICENSE_1_0.txt or copy at
//
http://www.boost.org/LICENSE_1_0.txt)
#
include
<
boost/config.hpp
>
#
ifdef
BOOST_NO_CXX11_RANGE_BASED_FOR
#
include
<
boost/stacktrace.hpp
>
#
include
<
iostream
>
//
std::cout
namespace
bs
=
boost::stacktrace;
void
dump_compact
(
const
bs::stacktrace& st) {
for
(
unsigned
i =
0
; i < st.
size
(); ++i) {
bs::frame frame = st[i];
std::cout << frame.
address
() <<
'
,
'
;
}
std::cout << std::endl;
}
#
else
//
[getting_started_trace_addresses
#
include
<
boost/stacktrace.hpp
>
#
include
<
iostream
>
//
std::cout
namespace
bs
=
boost::stacktrace;
void
dump_compact
(
const
bs::stacktrace& st) {
for
(bs::frame frame: st) {
std::cout << frame.
address
() <<
'
,
'
;
}
std::cout << std::endl;
}
//
]
#
endif
BOOST_NOINLINE
boost::stacktrace::stacktrace
rec1
(
int
i);
BOOST_NOINLINE
boost::stacktrace::stacktrace
rec2
(
int
i);
BOOST_NOINLINE
boost::stacktrace::stacktrace
rec1
(
int
i) {
if
(i <
5
) {
if
(!i)
return
boost::stacktrace::stacktrace
();
return
rec2
(--i);
}
return
rec2
(i -
2
);
}
BOOST_NOINLINE
boost::stacktrace::stacktrace
rec2
(
int
i) {
if
(i <
5
) {
if
(!i)
return
boost::stacktrace::stacktrace
();
return
rec2
(--i);
}
return
rec2
(i -
2
);
}
int
main
() {
dump_compact
(
rec1
(
8
));
}
Back
|
FazBrowse Home
|
New Git URL