Skip to content

Instantly share code, notes, and snippets.

@mikkeloscar
Last active January 30, 2016 16:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikkeloscar/badebca2b9766a067397 to your computer and use it in GitHub Desktop.
Save mikkeloscar/badebca2b9766a067397 to your computer and use it in GitHub Desktop.
import sys
import os
import re
lines = [l.rstrip() for l in sys.stdin.readlines()]
bt = re.compile(".*Backtrace: .*sway.*\[(0x[a-f\d]+)\]")
for line in lines:
result = bt.match(line)
if result:
print(line)
os.system("addr2line -e {} {}".format(sys.argv[1], result.group(1)))
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment