Bug 1254295 - add "flushregs" advice to unwinder instructions; r=nbp
authorTom Tromey <tom@tromey.com>
Mon, 31 Oct 2016 11:38:46 -0600
changeset 348688 5ba29d0fdd6d3a6cc1d2385e7d9d0b5cfd4adc5d
parent 348687 52736ea528a925cc1b0411ceeb20ae03510130fa
child 348689 c23a8d5e4088962b5c70359257bdc85c3aa189ec
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1254295
milestone52.0a1
Bug 1254295 - add "flushregs" advice to unwinder instructions; r=nbp MozReview-Commit-ID: A0jtO5yj4Og
js/src/gdb/mozilla/unwind.py
--- a/js/src/gdb/mozilla/unwind.py
+++ b/js/src/gdb/mozilla/unwind.py
@@ -520,16 +520,22 @@ class SpiderMonkeyUnwinder(Unwinder):
         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")
+        # Some versions of gdb did not flush the internal frame cache
+        # when enabling or disabling an unwinder.  This was fixed in
+        # the same release of gdb that added the breakpoint_created
+        # event.
+        if not hasattr(gdb.events, "breakpoint_created"):
+            gdb.write("\tflushregs\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):