diff options
author | Chaoren Lin <chaorenl@google.com> | 2015-07-14 01:09:28 +0000 |
---|---|---|
committer | Chaoren Lin <chaorenl@google.com> | 2015-07-14 01:09:28 +0000 |
commit | 98d0a4b39a89ad4d667d9150a008a0c36be94f1f (patch) | |
tree | 8aa89e4e73f775f57c5335d345f6dbbed804c13a /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | |
parent | 2b05416be8cc116c2910684cb6097039cd1e2cc5 (diff) | |
download | bcm5719-llvm-98d0a4b39a89ad4d667d9150a008a0c36be94f1f.tar.gz bcm5719-llvm-98d0a4b39a89ad4d667d9150a008a0c36be94f1f.zip |
Refactor Unix signals.
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.
Reviewers: ovyalov, clayborg
Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D11094
llvm-svn: 242101
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index ae25fb4b4f1..372ac789d6a 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -43,7 +43,6 @@ #include "lldb/Utility/StringExtractor.h" #include "Plugins/Process/POSIX/ProcessPOSIXLog.h" -#include "Plugins/Process/Utility/LinuxSignals.h" #include "NativeThreadLinux.h" #include "ProcFileReader.h" #include "Procfs.h" @@ -113,13 +112,6 @@ static bool ProcessVmReadvSupported() namespace { - const UnixSignals& - GetUnixSignals () - { - static process_linux::LinuxSignals signals; - return signals; - } - Error ResolveProcessArchitecture (lldb::pid_t pid, Platform &platform, ArchSpec &arch) { @@ -1987,7 +1979,7 @@ NativeProcessLinux::MonitorSignal(const siginfo_t *info, lldb::pid_t pid, bool e if (log) log->Printf ("NativeProcessLinux::%s() received signal %s (%d) with code %s, (siginfo pid = %d (%s), waitpid pid = %" PRIu64 ")", __FUNCTION__, - GetUnixSignals ().GetSignalAsCString (signo), + Host::GetSignalAsCString(signo), signo, (info->si_code == SI_TKILL ? "SI_TKILL" : "SI_USER"), info->si_pid, @@ -2062,7 +2054,7 @@ NativeProcessLinux::MonitorSignal(const siginfo_t *info, lldb::pid_t pid, bool e // Retrieve the signal name if the thread was stopped by a signal. int stop_signo = 0; const bool stopped_by_signal = linux_thread_sp->IsStopped (&stop_signo); - const char *signal_name = stopped_by_signal ? GetUnixSignals ().GetSignalAsCString (stop_signo) : "<not stopped by signal>"; + const char *signal_name = stopped_by_signal ? Host::GetSignalAsCString(stop_signo) : "<not stopped by signal>"; if (!signal_name) signal_name = "<no-signal-name>"; @@ -2083,7 +2075,7 @@ NativeProcessLinux::MonitorSignal(const siginfo_t *info, lldb::pid_t pid, bool e } if (log) - log->Printf ("NativeProcessLinux::%s() received signal %s", __FUNCTION__, GetUnixSignals ().GetSignalAsCString (signo)); + log->Printf ("NativeProcessLinux::%s() received signal %s", __FUNCTION__, Host::GetSignalAsCString(signo)); // This thread is stopped. ThreadDidStop (pid, false); @@ -2428,8 +2420,8 @@ NativeProcessLinux::Signal (int signo) Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) - log->Printf ("NativeProcessLinux::%s: sending signal %d (%s) to pid %" PRIu64, - __FUNCTION__, signo, GetUnixSignals ().GetSignalAsCString (signo), GetID ()); + log->Printf ("NativeProcessLinux::%s: sending signal %d (%s) to pid %" PRIu64, + __FUNCTION__, signo, Host::GetSignalAsCString(signo), GetID()); if (kill(GetID(), signo)) error.SetErrorToErrno(); @@ -3176,7 +3168,7 @@ NativeProcessLinux::Resume (lldb::tid_t tid, uint32_t signo) if (log) log->Printf ("NativeProcessLinux::%s() resuming thread = %" PRIu64 " with signal %s", __FUNCTION__, tid, - GetUnixSignals().GetSignalAsCString (signo)); + Host::GetSignalAsCString(signo)); |