Bug 1259867 - GDB Scripts: Disable SpiderMonkey's unwinder by default. r=tromey
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 01 Apr 2016 17:23:56 +0000
changeset 291281 9861363aaea9d0edd375f61522b058ab179543bb
parent 291280 99e7d6fbcbd9258a5fea2edb7615aeea89b3731e
child 291282 4030e1cd45b9abdbff070aa2302c22060d49f3f0
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1259867
milestone48.0a1
Bug 1259867 - GDB Scripts: Disable SpiderMonkey's unwinder by default. r=tromey
js/src/gdb/mozilla/unwind.py
js/src/gdb/tests/test-unwind.py
--- a/js/src/gdb/mozilla/unwind.py
+++ b/js/src/gdb/mozilla/unwind.py
@@ -373,16 +373,22 @@ class x64UnwinderState(UnwinderState):
 class SpiderMonkeyUnwinder(Unwinder):
     # A list of all the possible unwinders.  See |self.make_unwinder|.
     UNWINDERS = [x64UnwinderState]
 
     def __init__(self, typecache):
         super(SpiderMonkeyUnwinder, self).__init__("SpiderMonkey")
         self.typecache = typecache
         self.unwinder_state = None
+
+        # Disabled by default until we figure out issues in gdb.
+        self.enabled = False
+        gdb.write("SpiderMonkey unwinder is disabled by default, to enable it type:\n" +
+                  "\tenable unwinder .* SpiderMonkey\n")
+
         # We need to invalidate the unwinder state whenever the
         # inferior starts executing.  This avoids having a stale
         # cache.
         gdb.events.cont.connect(self.invalidate_unwinder_state)
         assert self.test_sentinels()
 
     def test_sentinels(self):
         # Self-check.
--- a/js/src/gdb/tests/test-unwind.py
+++ b/js/src/gdb/tests/test-unwind.py
@@ -1,13 +1,18 @@
 # Test the unwinder and the frame filter.
 
 import platform
 
 def do_unwinder_test():
+    # The unwinder is disabled by default for the moment. Turn it on to check
+    # that the unwinder works as expected.
+    import gdb
+    gdb.execute("enable unwinder .* SpiderMonkey")
+
     run_fragment('unwind.simple', 'Something')
 
     first = True
     # The unwinder is a bit flaky still but should at least be able to
     # recognize one set of entry and exit frames.  This also tests to
     # make sure we didn't end up solely in the interpreter.
     found_entry = False
     found_exit = False