summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-27 17:11:56 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-27 17:11:56 +0000
commit22972a7c59b937a6b5ca5fb700cd35407c457a70 (patch)
treefbfa6975be6a92826eb61f259aa6be8b27edd8f0 /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
parent0611d0141919bd8edf62ed043814a5d175177241 (diff)
downloadbcm5719-llvm-22972a7c59b937a6b5ca5fb700cd35407c457a70.tar.gz
bcm5719-llvm-22972a7c59b937a6b5ca5fb700cd35407c457a70.zip
NativeThreadLinux: remove translation of some Linux signals to gdb signals.
I copied this originally based on what debugserver was doing. This appears to be incorrect and unncessary for Linux. The LinuxSignals on the lldb side don't look for these and therefore they get handled incorrectly. Leaving the hook in place since I think darwin will continue to need to translate those signal numbers. llvm-svn: 216564
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp40
1 files changed, 14 insertions, 26 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index a1b674efee7..ef5b63a3f94 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -96,7 +96,6 @@ NativeThreadLinux::GetStopReason (ThreadStopInfo &stop_info)
case eStateRunning:
case eStateStepping:
case eStateDetached:
- default:
if (log)
{
log->Printf ("NativeThreadLinux::%s tid %" PRIu64 " in state %s cannot answer stop reason",
@@ -324,39 +323,28 @@ NativeThreadLinux::MaybeLogStateChange (lldb::StateType new_state)
log->Printf ("NativeThreadLinux: thread (pid=%" PRIu64 ", tid=%" PRIu64 ") changing from state %s to %s", pid, GetID (), StateAsCString (old_state), StateAsCString (new_state));
}
-static
-uint32_t MaybeTranslateHostSignoToGdbSigno (uint32_t host_signo)
-{
- switch (host_signo)
- {
- case SIGSEGV: return eGdbSignalBadAccess;
- case SIGILL: return eGdbSignalBadInstruction;
- case SIGFPE: return eGdbSignalArithmetic;
- // NOTE: debugserver sends SIGTRAP through unmodified. Do the same here.
- // case SIGTRAP: return eGdbSignalBreakpoint;
-
- // Nothing for eGdbSignalSoftware (0x95).
- // Nothing for eGdbSignalEmulation (0x94).
-
- default:
- // No translations.
- return host_signo;
- }
-}
-
uint32_t
NativeThreadLinux::TranslateStopInfoToGdbSignal (const ThreadStopInfo &stop_info) const
{
switch (stop_info.reason)
{
case eStopReasonSignal:
- return MaybeTranslateHostSignoToGdbSigno (stop_info.details.signal.signo);
- break;
+ // No translation.
+ return stop_info.details.signal.signo;
case eStopReasonException:
- // FIXME verify how we handle exception type.
- return MaybeTranslateHostSignoToGdbSigno (static_cast<uint32_t> (stop_info.details.exception.type));
- break;
+ {
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
+ // FIXME I think the eStopReasonException is a xnu/Mach exception, which we
+ // shouldn't see on Linux.
+ // No translation.
+ if (log)
+ log->Printf ("NativeThreadLinux::%s saw an exception stop type (signo %"
+ PRIu64 "), not expecting to see exceptions on Linux",
+ __FUNCTION__,
+ stop_info.details.exception.type);
+ return static_cast<uint32_t> (stop_info.details.exception.type);
+ }
default:
assert (0 && "unexpected stop_info.reason found");
OpenPOWER on IntegriCloud