Created
June 28, 2019 18:55
-
-
Save hotsphink/528fce120e413652c066a85850dc1f98 to your computer and use it in GitHub Desktop.
mkgist-created gist
This file contains hidden or 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
diff --git a/tools/rb/fix_stack_using_bpsyms.py b/tools/rb/fix_stack_using_bpsyms.py | |
--- a/tools/rb/fix_stack_using_bpsyms.py | |
+++ b/tools/rb/fix_stack_using_bpsyms.py | |
@@ -180,21 +180,27 @@ def addressToSymbol(file, address, symbo | |
p = getSymbolFile(file, symbolsDir) | |
if p: | |
return p.addrToSymbol(address) | |
else: | |
return "" | |
# Matches lines produced by NS_FormatCodeAddress(). | |
-line_re = re.compile("^(.*#\d+: )(.+)\[(.+) \+(0x[0-9A-Fa-f]+)\](.*)$") | |
+line_re1 = re.compile("^(.*#\d+: )(.+)\[(.+) \+(0x[0-9A-Fa-f]+)\](.*)$") | |
+line_re2 = re.compile(r'^(.*#\d+: )(.*\\)?([^\\]+) \+ (0x[0-9A-Fa-f]+)(.*)$') | |
+# "OLJ": "#00: Z:\\\\\\\\task_1561676930\\\\\\\\build\\\\\\\\application\\\\\\\\firefox\\\\\\\\xul.dll + 0x4b0bfe3", | |
def fixSymbols(line, symbolsDir, jsonEscape=False): | |
- result = line_re.match(line) | |
+ result = line_re1.match(line) | |
+ if not result: | |
+ result = line_re2.match(line) | |
+ #if line.find("xul.dll") > 0: | |
+ # import pdb; pdb.set_trace() | |
if result is not None: | |
(before, fn, file, address, after) = result.groups() | |
address = int(address, 16) | |
symbol = addressToSymbol(file, address, symbolsDir) | |
if not symbol: | |
symbol = "%s + 0x%x" % (os.path.basename(file), address) | |
if jsonEscape: | |
symbol = json.dumps(symbol)[1:-1] # [1:-1] strips the quotes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment