SERVER-41168 Port mongodb-specific debugging commands in gdb to lldb

This commit is contained in:
Mathew Robinson 2019-06-06 17:34:05 -04:00
parent 277229505f
commit cd8fc73729
2 changed files with 28 additions and 1 deletions

View File

@ -2,4 +2,5 @@
#
# settings set target.load-cwd-lldbinit true
#
command script import buildscripts/lldb/lldb_printers.py
command script import buildscripts/lldb/lldb_printers.py
command script import buildscripts/lldb/lldb_commands.py

View File

@ -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()")