Bug 1254295 - add "flushregs" advice to unwinder instructions; r=nbp
authorTom Tromey <tom@tromey.com>
Mon, 31 Oct 2016 11:38:46 -0600
changeset 322023 5ba29d0fdd6d3a6cc1d2385e7d9d0b5cfd4adc5d
parent 322022 52736ea528a925cc1b0411ceeb20ae03510130fa
child 322024 c23a8d5e4088962b5c70359257bdc85c3aa189ec
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
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):