summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-29 17:35:57 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-29 17:35:57 +0000
commit4ceced3f597f71e3b28d9e4f208d2786fff1ff45 (patch)
tree362e9f32a697d2b21c9f68c67e09646f00249e4c /lldb/source/Plugins/Process/gdb-remote
parentb5796cb40e6f7a5e504d8da41d0f31d4539d7110 (diff)
downloadbcm5719-llvm-4ceced3f597f71e3b28d9e4f208d2786fff1ff45.tar.gz
bcm5719-llvm-4ceced3f597f71e3b28d9e4f208d2786fff1ff45.zip
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
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp16
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h6
2 files changed, 5 insertions, 17 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index b50f071e980..f35d954caa7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -287,8 +287,7 @@ ProcessGDBRemote::ProcessGDBRemote(Target& target, Listener &listener) :
m_waiting_for_attach (false),
m_destroy_tried_resuming (false),
m_command_sp (),
- m_breakpoint_pc_offset (0),
- m_unix_signals_sp (new UnixSignals ())
+ m_breakpoint_pc_offset (0)
{
m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit, "async thread should exit");
m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue, "async thread continue");
@@ -713,19 +712,19 @@ ProcessGDBRemote::DoConnectRemote (Stream *strm, const char *remote_url)
switch (arch_spec.GetTriple ().getOS ())
{
case llvm::Triple::Linux:
- m_unix_signals_sp.reset (new process_linux::LinuxSignals ());
+ SetUnixSignals (UnixSignalsSP (new process_linux::LinuxSignals ()));
if (log)
log->Printf ("ProcessGDBRemote::%s using Linux unix signals type for pid %" PRIu64, __FUNCTION__, GetID ());
break;
case llvm::Triple::OpenBSD:
case llvm::Triple::FreeBSD:
case llvm::Triple::NetBSD:
- m_unix_signals_sp.reset (new FreeBSDSignals ());
+ SetUnixSignals (UnixSignalsSP (new FreeBSDSignals ()));
if (log)
log->Printf ("ProcessGDBRemote::%s using *BSD unix signals type for pid %" PRIu64, __FUNCTION__, GetID ());
break;
default:
- m_unix_signals_sp.reset (new UnixSignals ());
+ SetUnixSignals (UnixSignalsSP (new UnixSignals ()));
if (log)
log->Printf ("ProcessGDBRemote::%s using generic unix signals type for pid %" PRIu64, __FUNCTION__, GetID ());
break;
@@ -1086,13 +1085,6 @@ ProcessGDBRemote::DidLaunch ()
DidLaunchOrAttach (process_arch);
}
-UnixSignals&
-ProcessGDBRemote::GetUnixSignals ()
-{
- assert (m_unix_signals_sp && "m_unix_signals_sp is null");
- return *m_unix_signals_sp;
-}
-
Error
ProcessGDBRemote::DoAttachToProcessWithID (lldb::pid_t attach_pid)
{
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 39395af2ee5..942b31c84dd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -25,6 +25,7 @@
#include "lldb/Core/StringList.h"
#include "lldb/Core/StructuredData.h"
#include "lldb/Core/ThreadSafeValue.h"
+#include "lldb/lldb-private-forward.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Thread.h"
@@ -91,9 +92,6 @@ public:
virtual void
DidLaunch ();
- lldb_private::UnixSignals&
- GetUnixSignals () override;
-
virtual lldb_private::Error
WillAttachToProcessWithID (lldb::pid_t pid);
@@ -360,8 +358,6 @@ protected:
bool m_destroy_tried_resuming;
lldb::CommandObjectSP m_command_sp;
int64_t m_breakpoint_pc_offset;
- std::shared_ptr<lldb_private::UnixSignals> m_unix_signals_sp;
-
bool
StartAsyncThread ();
OpenPOWER on IntegriCloud