summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.lldbinit3
-rw-r--r--buildscripts/lldb/lldb_commands.py26
2 files changed, 28 insertions, 1 deletions
diff --git a/.lldbinit b/.lldbinit
index a6c588a6cc9..e4084129e21 100644
--- a/.lldbinit
+++ b/.lldbinit
@@ -2,4 +2,5 @@
#
# settings set target.load-cwd-lldbinit true
#
-command script import buildscripts/lldb/lldb_printers.py \ No newline at end of file
+command script import buildscripts/lldb/lldb_printers.py
+command script import buildscripts/lldb/lldb_commands.py \ No newline at end of file
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()")