Bug 1376842 - Update gdb support code to new wasm SIGSEGV handler, and some other updates, r=tromey
authorSteve Fink <sfink@mozilla.com>
Mon, 24 Jul 2017 17:04:22 -0700
changeset 419487 157445a8c76bae6dc9b8fc2449f8eb95b3cddbbd
parent 419486 6d804536ac55878e8fcdeae1781e7c84c91c0f47
child 419488 7aa7d265948aedd183932c40d27da60c03beee9e
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1376842
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1376842 - Update gdb support code to new wasm SIGSEGV handler, and some other updates, r=tromey DONTBUILD; this changes no compiled code and is only used when debugging.
js/src/gdb/mozilla/asmjs.py
js/src/gdb/mozilla/unwind.py
--- a/js/src/gdb/mozilla/asmjs.py
+++ b/js/src/gdb/mozilla/asmjs.py
@@ -14,25 +14,25 @@ def on_stop(event):
     if isinstance(event, gdb.SignalEvent) and event.stop_signal == 'SIGSEGV':
         # Allocate memory for sigaction, once per js shell process.
         process = gdb.selected_inferior()
         buf = sigaction_buffers.get(process)
         if buf is None:
             buf = gdb.parse_and_eval("(struct sigaction *) malloc(sizeof(struct sigaction))")
             sigaction_buffers[process] = buf
 
-        # See if AsmJSFaultHandler is installed as the SIGSEGV signal action.
+        # See if WasmFaultHandler is installed as the SIGSEGV signal action.
         sigaction_fn = gdb.parse_and_eval('__sigaction')
         sigaction_fn(SIGSEGV, 0, buf)
-        AsmJSFaultHandler = gdb.parse_and_eval("AsmJSFaultHandler")
-        if buf['__sigaction_handler']['sa_handler'] == AsmJSFaultHandler:
+        WasmFaultHandler = gdb.parse_and_eval("WasmFaultHandler<(Signal)0>")
+        if buf['__sigaction_handler']['sa_handler'] == WasmFaultHandler:
             # Advise the user that magic is happening.
-            print("js/src/gdb/mozilla/asmjs.py: Allowing AsmJSFaultHandler to run.")
+            print("js/src/gdb/mozilla/asmjs.py: Allowing WasmFaultHandler to run.")
 
-            # If AsmJSFaultHandler doesn't handle this segfault, it will unhook
+            # If WasmFaultHandler doesn't handle this segfault, it will unhook
             # itself and re-raise.
             gdb.execute("continue")
 
 def on_exited(event):
     if event.inferior in sigaction_buffers:
         del sigaction_buffers[event.inferior]
 
 def install():
--- a/js/src/gdb/mozilla/unwind.py
+++ b/js/src/gdb/mozilla/unwind.py
@@ -38,16 +38,17 @@ def debug(something):
 SizeOfFramePrefix = {
     'JitFrame_IonJS': 'ExitFrameLayout',
     'JitFrame_BaselineJS': 'JitFrameLayout',
     'JitFrame_BaselineStub': 'BaselineStubFrameLayout',
     'JitFrame_IonStub': 'JitStubFrameLayout',
     'JitFrame_Entry': 'JitFrameLayout',
     'JitFrame_Rectifier': 'RectifierFrameLayout',
     'JitFrame_IonAccessorIC': 'IonAccessorICFrameLayout',
+    'JitFrame_IonICCall': 'IonICCallFrameLayout',
     'JitFrame_Exit': 'ExitFrameLayout',
     'JitFrame_Bailout': 'JitFrameLayout',
 }
 
 # All types and symbols that we need are attached to an object that we
 # can dispose of as needed.
 class UnwinderTypeCache(object):
     def __init__(self):
@@ -324,22 +325,22 @@ class UnwinderState(object):
         return False
 
     # See whether |pc| is claimed by the Jit.
     def is_jit_address(self, pc):
         if self.proc_mappings != None:
             return not self.text_address_claimed(pc)
 
         cx = self.get_tls_context()
-        runtime = cx['runtime_']
-        if runtime == 0:
+        runtime = cx['runtime_']['value']
+        if long(runtime.address) == 0:
             return False
 
         jitRuntime = runtime['jitRuntime_']
-        if jitRuntime == 0:
+        if long(jitRuntime.address) == 0:
             return False
 
         execAllocators = [jitRuntime['execAlloc_'], jitRuntime['backedgeExecAlloc_']]
         for execAlloc in execAllocators:
             for pool in jsjitExecutableAllocator(execAlloc, self.typecache):
                 pages = pool['m_allocation']['pages']
                 size = pool['m_allocation']['size']
                 if pages <= pc and pc < pages + size: