Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/826f4e161c8c8f65fa9d8be716caf73faa41a5b6
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/826f4e161c8c8f65fa9d8be716caf73faa41a5b6
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/826f4e161c8c8f65fa9d8be716caf73faa41a5b6

The branch, master has been updated
       via  826f4e161c8c8f65fa9d8be716caf73faa41a5b6 (commit)
      from  d71d2632b42c7253a2e6d873a78d4fb458036484 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=826f4e161c8c8f65fa9d8be716caf73faa41a5b6
commit 826f4e161c8c8f65fa9d8be716caf73faa41a5b6
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    improve monkey-see-monkey-do backtrace output to include function name

diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do
index b158dbd..4dc761a 100755
--- a/test/monkey-see-monkey-do
+++ b/test/monkey-see-monkey-do
@@ -24,19 +24,27 @@ MONKEY_PATH = "./nsmonkey"
 
 mp.set_start_method('fork')
 
+def decode_trace_line(l):
+    from re import findall, match
+    from subprocess import getstatusoutput
+
+    caps = findall(r'./nsmonkey\(\+(0x[0-9a-f]+)\)', l);
+    if not caps:
+        return l
+
+    exitcode, output = getstatusoutput(
+        "addr2line -e {} -a -p -f -C {} 2>/dev/null".format(
+            MONKEY_PATH, caps[0]))
+    if exitcode != 0:
+        return './nsmonkey(+{})'.format(caps[0])
+
+    m = match(r'0x(.+): (.+) at (.+):(.+)', output)
+
+    return '{}:{}({})[0x{}]'.format(
+        m.group(3), m.group(4), m.group(2), m.group(1))
+
 def decode_trace(s):
-    import re
-    from subprocess import getoutput
-    addr_re = re.compile(r"./nsmonkey\(\+(0x[0-9a-f]+)\)")
-    def decode_line(l):
-        caps = addr_re.findall(l);
-        if caps:
-            return getoutput(
-                "addr2line -e {} {} 2>/dev/null || echo 
'./nsmonkey(+{})'".format(
-                    MONKEY_PATH, caps[0], caps[0]))
-        else:
-            return l
-    return "\n".join(decode_line(l) for l in s.split("\n"))
+    return "\n".join(decode_trace_line(l) for l in s.split("\n"))
 
 def child_run_test(verbose, parts):
     outcapture = StringIO()


-----------------------------------------------------------------------

Summary of changes:
 test/monkey-see-monkey-do |   32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/test/monkey-see-monkey-do b/test/monkey-see-monkey-do
index b158dbd..4dc761a 100755
--- a/test/monkey-see-monkey-do
+++ b/test/monkey-see-monkey-do
@@ -24,19 +24,27 @@ MONKEY_PATH = "./nsmonkey"
 
 mp.set_start_method('fork')
 
+def decode_trace_line(l):
+    from re import findall, match
+    from subprocess import getstatusoutput
+
+    caps = findall(r'./nsmonkey\(\+(0x[0-9a-f]+)\)', l);
+    if not caps:
+        return l
+
+    exitcode, output = getstatusoutput(
+        "addr2line -e {} -a -p -f -C {} 2>/dev/null".format(
+            MONKEY_PATH, caps[0]))
+    if exitcode != 0:
+        return './nsmonkey(+{})'.format(caps[0])
+
+    m = match(r'0x(.+): (.+) at (.+):(.+)', output)
+
+    return '{}:{}({})[0x{}]'.format(
+        m.group(3), m.group(4), m.group(2), m.group(1))
+
 def decode_trace(s):
-    import re
-    from subprocess import getoutput
-    addr_re = re.compile(r"./nsmonkey\(\+(0x[0-9a-f]+)\)")
-    def decode_line(l):
-        caps = addr_re.findall(l);
-        if caps:
-            return getoutput(
-                "addr2line -e {} {} 2>/dev/null || echo 
'./nsmonkey(+{})'".format(
-                    MONKEY_PATH, caps[0], caps[0]))
-        else:
-            return l
-    return "\n".join(decode_line(l) for l in s.split("\n"))
+    return "\n".join(decode_trace_line(l) for l in s.split("\n"))
 
 def child_run_test(verbose, parts):
     outcapture = StringIO()


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to