[Lldb-commits] [lldb] r238872 - Update TestConcurrentEvents to use UnixSignals instead of python signals.

Chaoren Lin chaorenl at google.com
Tue Jun 2 14:54:23 PDT 2015


Author: chaoren
Date: Tue Jun  2 16:54:22 2015
New Revision: 238872

URL: http://llvm.org/viewvc/llvm-project?rev=238872&view=rev
Log:
Update TestConcurrentEvents to use UnixSignals instead of python signals.

Reviewers: clayborg, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10195

Modified:
    lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py

Modified: lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py?rev=238872&r1=238871&r2=238872&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py (original)
+++ lldb/trunk/test/functionalities/thread/concurrent_events/TestConcurrentEvents.py Tue Jun  2 16:54:22 2015
@@ -10,18 +10,12 @@ until exit or a crash takes place, and t
 verified to match the expected number of events.
 """
 
-import os, signal, time
+import os, time
 import unittest2
 import lldb
 from lldbtest import *
 import lldbutil
 
-# ==================================================
-# Dictionary of signal names
-# ==================================================
-signal_names = dict((getattr(signal, n), n) \
-        for n in dir(signal) if n.startswith('SIG') and '_' not in n )
-
 @skipIfWindows
 class ConcurrentEventsTestCase(TestBase):
 
@@ -366,7 +360,9 @@ class ConcurrentEventsTestCase(TestBase)
                 watch = self.inferior_target.FindWatchpointByID(watchid)
                 reason_str = "%s hit %d times" % (lldbutil.get_description(watch), watch.GetHitCount())
             elif reason == lldb.eStopReasonSignal:
-                reason_str = "signal %s" % (signal_names[x.GetStopReasonDataAtIndex(0)])
+                signals = self.inferior_process.GetUnixSignals()
+                signal_name = signals.GetSignalAsCString(x.GetStopReasonDataAtIndex(0))
+                reason_str = "signal %s" % signal_name
 
             location = "\t".join([lldbutil.get_description(x.GetFrameAtIndex(i)) for i in range(x.GetNumFrames())])
             ret.append("thread %d %s due to %s at\n\t%s" % (id, status, reason_str, location))





More information about the lldb-commits mailing list