Skip to content

Commit

Permalink
tools/stack_decode.py: backtrace.h doesn't always emit a symbol name
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
  • Loading branch information
LukeShu committed Aug 26, 2019
1 parent 3f88846 commit 00ee946
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/stack_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
def decode_stacktrace_log(object_file, input_source):
traces = {}
# Match something like:
# [backtrace] bazel-out/local-dbg/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:84]
# [backtrace] [bazel-out/local-dbg/bin/source/server/_virtual_includes/backtrace_lib/server/backtrace.h:84]
backtrace_marker = "\[backtrace\] [^\s]+"
# Match something like:
# ${backtrace_marker} #10: SYMBOL [0xADDR]
stackaddr_re = re.compile("%s #\d+: .* \[(0x[0-9a-fA-F]+)\]$" % backtrace_marker)
# or:
# ${backtrace_marker} #10: [0xADDR]
stackaddr_re = re.compile("%s #\d+:(?: .*)? \[(0x[0-9a-fA-F]+)\]$" % backtrace_marker)

try:
while True:
Expand Down

0 comments on commit 00ee946

Please sign in to comment.