[Lldb-commits] [lldb] r238857 - Check that debugger is valid before enumerating targets.
Chaoren Lin
chaorenl at google.com
Tue Jun 2 11:31:57 PDT 2015
Author: chaoren
Date: Tue Jun 2 13:31:57 2015
New Revision: 238857
URL: http://llvm.org/viewvc/llvm-project?rev=238857&view=rev
Log:
Check that debugger is valid before enumerating targets.
Reviewers: sivachandra
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10192
Modified:
lldb/trunk/test/lldbutil.py
Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=238857&r1=238856&r2=238857&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Tue Jun 2 13:31:57 2015
@@ -949,17 +949,18 @@ def get_signal_number(signal_name):
output = 'SIG' + output
if output == signal_name:
return signal_number
- for target_index in range(lldb.debugger.GetNumTargets()):
- target = lldb.debugger.GetTargetAtIndex(target_index)
- if not target.IsValid():
- continue
- process = target.GetProcess()
- if not process.IsValid():
- continue
- signals = process.GetUnixSignals()
- if not signals.IsValid():
- continue
- signal_number = signals.GetSignalNumberFromName(signal_name)
- if signal_number > 0:
- return signal_number
+ if lldb.debugger:
+ for target_index in range(lldb.debugger.GetNumTargets()):
+ target = lldb.debugger.GetTargetAtIndex(target_index)
+ if not target.IsValid():
+ continue
+ process = target.GetProcess()
+ if not process.IsValid():
+ continue
+ signals = process.GetUnixSignals()
+ if not signals.IsValid():
+ continue
+ signal_number = signals.GetSignalNumberFromName(signal_name)
+ if signal_number > 0:
+ return signal_number
return getattr(signal, signal_name)
More information about the lldb-commits
mailing list