forked from OSchip/llvm-project
Add the ability to specify logging options for lldb and gdb-remote through two
additional env variables. llvm-svn: 111295
This commit is contained in:
parent
e76896c987
commit
8a05de4d29
|
@ -176,17 +176,28 @@ lldb.DBG = lldb.SBDebugger.Create()
|
|||
ci = lldb.DBG.GetCommandInterpreter()
|
||||
res = lldb.SBCommandReturnObject()
|
||||
if ("LLDB_LOG" in os.environ):
|
||||
if ("LLDB_LOG_OPTION" in os.environ):
|
||||
lldb_log_option = os.environ["LLDB_LOG_OPTION"]
|
||||
else:
|
||||
lldb_log_option = "event process"
|
||||
ci.HandleCommand(
|
||||
"log enable -f " + os.environ["LLDB_LOG"] + " lldb default", res)
|
||||
"log enable -f " + os.environ["LLDB_LOG"] + " lldb " + lldb_log_option,
|
||||
res)
|
||||
if not res.Succeeded():
|
||||
raise Exception('log enable failed (check your LLDB_LOG env variable...')
|
||||
raise Exception('log enable failed (check LLDB_LOG env variable.')
|
||||
# Ditto for gdb-remote logging if ${LLDB_LOG} environment variable is defined.
|
||||
# Use ${GDB_REMOTE_LOG} to specify the log file.
|
||||
if ("GDB_REMOTE_LOG" in os.environ):
|
||||
if ("GDB_REMOTE_LOG_OPTION" in os.environ):
|
||||
gdb_remote_log_option = os.environ["GDB_REMOTE_LOG_OPTION"]
|
||||
else:
|
||||
gdb_remote_log_option = "packets"
|
||||
ci.HandleCommand(
|
||||
"log enable -f " + os.environ["GDB_REMOTE_LOG"] + " process.gdb-remote packets", res)
|
||||
"log enable -f " + os.environ["GDB_REMOTE_LOG"] + " process.gdb-remote "
|
||||
+ gdb_remote_log_option,
|
||||
res)
|
||||
if not res.Succeeded():
|
||||
raise Exception('log enable failed (check your GDB_REMOTE_LOG env variable...')
|
||||
raise Exception('log enable failed (check GDB_REMOTE_LOG env variable.')
|
||||
|
||||
# Install the control-c handler.
|
||||
unittest2.signals.installHandler()
|
||||
|
|
Loading…
Reference in New Issue