summaryrefslogtreecommitdiff
path: root/buildscripts/lldb
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2019-06-06 17:34:05 -0400
committerMathew Robinson <chasinglogic@gmail.com>2019-06-17 09:48:46 -0400
commitcd8fc73729417a11fe65a1c5b1b540bcaba95420 (patch)
tree7807c1ed111bb35e60287507b70e88d2d0b74fe5 /buildscripts/lldb
parent277229505fd9f05d0ea2f6baa25afbdb8d8171a4 (diff)
downloadmongo-cd8fc73729417a11fe65a1c5b1b540bcaba95420.tar.gz
SERVER-41168 Port mongodb-specific debugging commands in gdb to lldb
Diffstat (limited to 'buildscripts/lldb')
-rw-r--r--buildscripts/lldb/lldb_commands.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/buildscripts/lldb/lldb_commands.py b/buildscripts/lldb/lldb_commands.py
new file mode 100644
index 00000000000..a957cf83fb0
--- /dev/null
+++ b/buildscripts/lldb/lldb_commands.py
@@ -0,0 +1,26 @@
+import lldb
+
+def __lldb_init_module(debugger, dict):
+ ############################
+ # register custom commands #
+ ############################
+ debugger.HandleCommand("command script add -f lldb_commands.PrintGlobalServiceContext mongodb-service-context")
+ debugger.HandleCommand("command script add -f lldb_commands.PrintGlobalServiceContext mongodb-dump-locks")
+ debugger.HandleCommand("command script alias mongodb-help help")
+
+
+#######################
+# Command Definitions #
+#######################
+
+def PrintGlobalServiceContext(debugger, *args):
+ """
+ Provides the same convenience command available in GDB
+ integrations to print the globalServiceContext.
+ """
+ debugger.HandleCommand("print *globalServiceContext")
+
+
+def MongoDBDumpLocks(debugger, *args):
+ """Dump locks in the mongod process."""
+ debugger.HandleCommand("call globalLockManager.dump()")