Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
folly
Commits
6b4082ec
Commit
6b4082ec
authored
Sep 10, 2012
by
Tudor Bosman
Committed by
Jordan DeLong
Sep 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verbosify exception tracer dumps
Test Plan: by hand Reviewed By: philipp@fb.com FB internal diff: D570233
parent
78ee2805
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
+21
-11
folly/experimental/exception_tracer/ExceptionTracer.cpp
folly/experimental/exception_tracer/ExceptionTracer.cpp
+21
-11
No files found.
folly/experimental/exception_tracer/ExceptionTracer.cpp
View file @
6b4082ec
...
...
@@ -44,18 +44,27 @@ namespace exception_tracer {
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
ExceptionInfo
&
info
)
{
out
<<
"Exception type: "
;
if
(
info
.
type
)
{
out
<<
folly
::
demangle
(
*
info
.
type
)
<<
"
\n
"
;
out
<<
folly
::
demangle
(
*
info
.
type
);
}
else
{
out
<<
"(unknown type)
\n
"
;
out
<<
"(unknown type)"
;
}
Symbolizer
symbolizer
;
folly
::
StringPiece
symbolName
;
Dwarf
::
LocationInfo
location
;
for
(
auto
ip
:
info
.
frames
)
{
// Symbolize the previous address because the IP might be in the
// next function, per glog/src/signalhandler.cc
symbolizer
.
symbolize
(
ip
-
1
,
symbolName
,
location
);
Symbolizer
::
write
(
out
,
ip
,
symbolName
,
location
);
out
<<
" ("
<<
info
.
frames
.
size
()
<<
(
info
.
frames
.
size
()
==
1
?
" frame"
:
" frames"
)
<<
")
\n
"
;
try
{
Symbolizer
symbolizer
;
folly
::
StringPiece
symbolName
;
Dwarf
::
LocationInfo
location
;
for
(
auto
ip
:
info
.
frames
)
{
// Symbolize the previous address because the IP might be in the
// next function, per glog/src/signalhandler.cc
symbolizer
.
symbolize
(
ip
-
1
,
symbolName
,
location
);
Symbolizer
::
write
(
out
,
ip
,
symbolName
,
location
);
}
}
catch
(
const
std
::
exception
&
e
)
{
out
<<
"
\n
!! caught "
<<
folly
::
exceptionStr
(
e
)
<<
"
\n
"
;
}
catch
(...)
{
out
<<
"
\n
!!! caught unexpected exception
\n
"
;
}
return
out
;
}
...
...
@@ -159,10 +168,11 @@ void dumpExceptionStack(const char* prefix) {
if
(
exceptions
.
empty
())
{
return
;
}
LOG
(
ERROR
)
<<
prefix
<<
", exception stack follows
\n
"
;
LOG
(
ERROR
)
<<
prefix
<<
", exception stack follows"
;
for
(
auto
&
exc
:
exceptions
)
{
LOG
(
ERROR
)
<<
exc
<<
"
\n
"
;
}
LOG
(
ERROR
)
<<
"exception stack complete"
;
}
void
terminateHandler
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment