Created
May 16, 2012 16:20
-
-
Save nmaier/2711823 to your computer and use it in GitHub Desktop.
gdb unique code paths
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gdb binary | |
(gdb) b JS_NewCompartmentAndGlobalObject | |
(gdb) commands | |
> bt 12 | |
> continue | |
> end | |
(gdb) set logging on | |
(gdb) r <args> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
d = [] | |
o = None | |
with open(sys.argv[1]) as op: | |
for line in op: | |
m = re.match("#0", line) | |
if m: | |
if o: | |
d += "\n".join(o), | |
o = [] | |
continue | |
m = re.match(r"(#\d+)\s+.*?in\s+(.*?)\s", line) | |
if m: | |
o += "{} {}".format(*m.groups()), | |
for c in set(d): | |
print c | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment