summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2019-07-12 14:25:51 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2019-07-12 14:25:51 -0400
commit9c2a42465d1a711da542c99632ce9c92fa0a80d1 (patch)
treefa564de4ce4784199e682613062808b60cbce072 /buildscripts
parent2467031debe8f2373c060195fb7e3bc02f68e686 (diff)
downloadmongo-9c2a42465d1a711da542c99632ce9c92fa0a80d1.tar.gz
SERVER-42032 Replace parse_and_eval() usage in mongodb-javascript-stack.
(cherry picked from commit 4bdf1fd63dc793a6d36d1f9da660c9747478206b)
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/gdb/mongo.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/buildscripts/gdb/mongo.py b/buildscripts/gdb/mongo.py
index 3e4ced9e4e3..2e87def1902 100644
--- a/buildscripts/gdb/mongo.py
+++ b/buildscripts/gdb/mongo.py
@@ -523,6 +523,12 @@ class MongoDBJavaScriptStack(gdb.Command):
print("Ignoring invalid thread %d in javascript_stack" % thread.num)
continue
thread.switch()
+
+ # Switch frames so gdb actually knows about the mongo::mozjs namespace. It doesn't
+ # actually matter which frame so long as it isn't the top of the stack. This also
+ # enables gdb to know about the mongo::mozjs::kCurrentScope thread-local variable
+ # when using gdb.parse_and_eval().
+ gdb.selected_frame().older().select()
except gdb.error as err:
print("Ignoring GDB error '%s' in javascript_stack" % str(err))
continue