diff options
author | Mathias Stearn <mathias@10gen.com> | 2016-08-29 17:59:51 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2016-09-08 14:13:46 -0400 |
commit | 9b029f19fe3644d59533ccd7cb995103fbbaa41d (patch) | |
tree | 3b55f719fb0e8a00a1dd5ba831581fbe41892f22 /buildscripts | |
parent | bd01e64a6566785f01a642cfc7676cd8da484a8f (diff) | |
download | mongo-9b029f19fe3644d59533ccd7cb995103fbbaa41d.tar.gz |
SERVER-25967 fix mongosymb.py output
Corrects for the return address not being off by one, and adds the
column and final colon to the output. This makes it match compiler error
output format which makes it easier to integrate into editors.
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/mongosymb.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/buildscripts/mongosymb.py b/buildscripts/mongosymb.py index d2c707c4c4f..974671d080c 100755 --- a/buildscripts/mongosymb.py +++ b/buildscripts/mongosymb.py @@ -51,6 +51,12 @@ def symbolize_frames(trace_doc, dbg_path_resolver, symbolizer_path=None, dsym_hi else: addr_base = soinfo.get("vmaddr", "0") addr = long(addr_base, 16) + long(frame["o"], 16) + # addr currently points to the return address which is the one *after* the call. x86 is + # variable length so going backwards is difficult. However llvm-symbolizer seems to do the + # right thing if we just subtract 1 byte here. This has the downside of also adjusting the + # address of instructions that cause signals (such as segfaults and divide-by-zero) which + # are already correct, but there doesn't seem to be a reliable way to detect that case. + addr -= 1 frames.append(dict(path=dbg_path_resolver.get_dbg_file(soinfo), buildId=soinfo.get("buildId", None), offset=frame["o"], @@ -145,7 +151,7 @@ def classic_output(frames, outfile, **kwargs): symbinfo = frame["symbinfo"] if len(symbinfo) > 0: for sframe in symbinfo: - outfile.write(" %(file)s:%(line)s %(fn)s\n" % sframe) + outfile.write(" %(file)s:%(line)s:%(column)s: %(fn)s\n" % sframe) else: outfile.write(" %(path)s!!!\n" % symbinfo) |