mozdebug
— Configure and launch compatible debuggers.¶
This module contains a set of function to gather information about the debugging capabilities of the platform. It allows to look for a specific debugger or to query the system for a compatible/default debugger.
The following simple example looks for the default debugger on the current platform and launches a debugger process with the correct debugger-specific arguments:
import mozdebug
debugger = mozdebug.get_default_debugger_name()
debuggerInfo = mozdebug.get_debugger_info(debugger)
debuggeePath = "toDebug"
processArgs = [self.debuggerInfo.path] + self.debuggerInfo.args
processArgs.append(debuggeePath)
run_process(args, ...)
- mozdebug.get_debugger_info(debugger, debuggerArgs=None, debuggerInteractive=False)¶
Get the information about the requested debugger.
Returns a dictionary containing the
path
of the debugger executable, if it will run ininteractive
mode, its arguments and whether it needs to escape arguments it passes to the debugged program (requiresEscapedArgs
). If the debugger cannot be found in the system, returnsNone
.- Parameters:
debugger – The name of the debugger.
debuggerArgs – If specified, it’s the arguments to pass to the debugger, as a string. Any debugger-specific separator arguments are appended after these arguments.
debuggerInteractive – If specified, forces the debugger to be interactive.
- mozdebug.get_default_debugger_name(search=1)¶
Get the debugger name for the default debugger on current platform.
- Parameters:
search – If specified, stops looking for the debugger if the default one is not found (
DebuggerSearch.OnlyFirst
) or keeps looking for other compatible debuggers (DebuggerSearch.KeepLooking
).