summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2019-07-12 14:15:28 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2019-07-12 14:15:28 -0400
commit4bdf1fd63dc793a6d36d1f9da660c9747478206b (patch)
tree894d735808089bad5950724448315644fedab7bd
parenteaba1b8c34eb05697112364b764921e1128a79ce (diff)
downloadmongo-4bdf1fd63dc793a6d36d1f9da660c9747478206b.tar.gz
SERVER-42032 Replace parse_and_eval() usage in mongodb-javascript-stack.
-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