Consolidate UnixSignals setting/getting in Process.
See http://reviews.llvm.org/D5108 for details.
This change does the following:
* eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter.
* replaces the Process UnixSignals storage with a shared pointer.
* adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used.
* adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant.
* replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process.
This change also enables some future patches that will enable llgs to be used for local Linux debugging.
llvm-svn: 216748
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
index dae14d1..81151b6 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -22,12 +22,23 @@
#include "ProcessLinux.h"
#include "ProcessPOSIXLog.h"
#include "Plugins/Process/Utility/InferiorCallPOSIX.h"
+#include "Plugins/Process/Utility/LinuxSignals.h"
#include "ProcessMonitor.h"
#include "LinuxThread.h"
using namespace lldb;
using namespace lldb_private;
+namespace
+{
+ UnixSignalsSP&
+ GetStaticLinuxSignalsSP ()
+ {
+ static UnixSignalsSP s_unix_signals_sp (new process_linux::LinuxSignals ());
+ return s_unix_signals_sp;
+ }
+}
+
//------------------------------------------------------------------------------
// Static functions.
@@ -64,7 +75,7 @@
// Constructors and destructors.
ProcessLinux::ProcessLinux(Target& target, Listener &listener, FileSpec *core_file)
- : ProcessPOSIX(target, listener), m_core_file(core_file), m_stopping_threads(false)
+ : ProcessPOSIX(target, listener, GetStaticLinuxSignalsSP ()), m_core_file(core_file), m_stopping_threads(false)
{
#if 0
// FIXME: Putting this code in the ctor and saving the byte order in a