forked from OSchip/llvm-project
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 llvm-svn: 238872
This commit is contained in:
parent
5e3f20d791
commit
e79b472162
|
@ -10,18 +10,12 @@ until exit or a crash takes place, and the number of events seen by LLDB is
|
||||||
verified to match the expected number of events.
|
verified to match the expected number of events.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os, signal, time
|
import os, time
|
||||||
import unittest2
|
import unittest2
|
||||||
import lldb
|
import lldb
|
||||||
from lldbtest import *
|
from lldbtest import *
|
||||||
import lldbutil
|
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
|
@skipIfWindows
|
||||||
class ConcurrentEventsTestCase(TestBase):
|
class ConcurrentEventsTestCase(TestBase):
|
||||||
|
|
||||||
|
@ -366,7 +360,9 @@ class ConcurrentEventsTestCase(TestBase):
|
||||||
watch = self.inferior_target.FindWatchpointByID(watchid)
|
watch = self.inferior_target.FindWatchpointByID(watchid)
|
||||||
reason_str = "%s hit %d times" % (lldbutil.get_description(watch), watch.GetHitCount())
|
reason_str = "%s hit %d times" % (lldbutil.get_description(watch), watch.GetHitCount())
|
||||||
elif reason == lldb.eStopReasonSignal:
|
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())])
|
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))
|
ret.append("thread %d %s due to %s at\n\t%s" % (id, status, reason_str, location))
|
||||||
|
|
Loading…
Reference in New Issue