summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r--lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp5
-rw-r--r--lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp74
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h8
4 files changed, 19 insertions, 70 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
index 259c08072a1..b3933169841 100644
--- a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
@@ -235,9 +235,7 @@ ProcessMacOSX::ProcessMacOSX(Target& target, Listener &listener) :
m_exception_messages (),
m_exception_messages_mutex (Mutex::eMutexTypeRecursive),
m_arch_spec (),
- m_dynamic_loader_ap (),
-// m_wait_thread (LLDB_INVALID_HOST_THREAD),
- m_byte_order (eByteOrderHost)
+ m_dynamic_loader_ap ()
{
}
@@ -676,6 +674,7 @@ ProcessMacOSX::RefreshStateAfterStop ()
Error
ProcessMacOSX::DoHalt (bool &caused_stop)
{
+ caused_stop = true;
return Signal (SIGSTOP);
}
diff --git a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
index 92d2c9c1653..4f8bdb930b7 100644
--- a/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
+++ b/lldb/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
@@ -247,8 +247,6 @@ protected:
lldb_private::Mutex m_exception_messages_mutex; // Multithreaded protection for m_exception_messages
lldb_private::ArchSpec m_arch_spec;
std::auto_ptr<lldb_private::DynamicLoader> m_dynamic_loader_ap;
-// lldb::thread_t m_wait_thread;
- lldb::ByteOrder m_byte_order;
//----------------------------------------------------------------------
// Child process control
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index fcbd523699f..5496a02343a 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -105,7 +105,6 @@ ProcessGDBRemote::ProcessGDBRemote(Target& target, Listener &listener) :
m_dynamic_loader_ap (),
m_flags (0),
m_stdio_mutex (Mutex::eMutexTypeRecursive),
- m_byte_order (eByteOrderHost),
m_gdb_comm(),
m_debugserver_pid (LLDB_INVALID_PROCESS_ID),
m_debugserver_thread (LLDB_INVALID_HOST_THREAD),
@@ -339,13 +338,13 @@ ProcessGDBRemote::WillLaunch (Module* module)
}
Error
-ProcessGDBRemote::WillAttach (lldb::pid_t pid)
+ProcessGDBRemote::WillAttachToProcessWithID (lldb::pid_t pid)
{
return WillLaunchOrAttach ();
}
Error
-ProcessGDBRemote::WillAttach (const char *process_name, bool wait_for_launch)
+ProcessGDBRemote::WillAttachToProcessWithName (const char *process_name, bool wait_for_launch)
{
return WillLaunchOrAttach ();
}
@@ -556,8 +555,6 @@ ProcessGDBRemote::ConnectToDebugserver (const char *host_port)
if (response.IsOKPacket())
m_gdb_comm.SetAckMode (false);
}
-
- BuildDynamicRegisterInfo ();
}
return error;
}
@@ -574,22 +571,23 @@ ProcessGDBRemote::DidLaunchOrAttach ()
{
m_dispatch_queue_offsets_addr = LLDB_INVALID_ADDRESS;
- Module * exe_module = GetTarget().GetExecutableModule ().get();
+ BuildDynamicRegisterInfo ();
+
+ m_byte_order = m_gdb_comm.GetByteOrder();
+
+ Module * exe_module = GetTarget().GetExecutableModule().get();
assert(exe_module);
ObjectFile *exe_objfile = exe_module->GetObjectFile();
assert(exe_objfile);
- m_byte_order = exe_objfile->GetByteOrder();
- assert (m_byte_order != eByteOrderInvalid);
-
StreamString strm;
ArchSpec inferior_arch;
// See if the GDB server supports the qHostInfo information
const char *vendor = m_gdb_comm.GetVendorString().AsCString();
const char *os_type = m_gdb_comm.GetOSString().AsCString();
- ArchSpec arch_spec = GetTarget().GetArchitecture();
+ ArchSpec arch_spec (GetTarget().GetArchitecture());
if (arch_spec.IsValid() && arch_spec == ArchSpec ("arm"))
{
@@ -858,25 +856,8 @@ ProcessGDBRemote::DoAttachToProcessWithName (const char *process_name, bool wait
void
ProcessGDBRemote::DidAttach ()
{
- // If we haven't got an executable module yet, then we should make a dynamic loader, and
- // see if it can find the executable module for us. If we do have an executable module,
- // make sure it matches the process we've just attached to.
-
- ModuleSP exe_module_sp = GetTarget().GetExecutableModule();
- if (!m_dynamic_loader_ap.get())
- {
- m_dynamic_loader_ap.reset(DynamicLoader::FindPlugin(this, "dynamic-loader.macosx-dyld"));
- }
-
if (m_dynamic_loader_ap.get())
m_dynamic_loader_ap->DidAttach();
-
- Module * new_exe_module = GetTarget().GetExecutableModule().get();
- if (new_exe_module == NULL)
- {
-
- }
-
DidLaunchOrAttach ();
}
@@ -1124,45 +1105,26 @@ Error
ProcessGDBRemote::DoHalt (bool &caused_stop)
{
Error error;
- caused_stop = false;
if (m_gdb_comm.IsRunning())
{
- PausePrivateStateThread();
+ caused_stop = true;
bool timed_out = false;
Mutex::Locker locker;
- if (m_gdb_comm.SendInterrupt (locker, 2, &timed_out))
- {
- EventSP event_sp;
- TimeValue timeout_time;
- timeout_time = TimeValue::Now();
- timeout_time.OffsetWithSeconds(2);
-
- StateType state = WaitForStateChangedEventsPrivate (&timeout_time, event_sp);
-
- if (!StateIsStoppedState (state))
- {
- LogSP log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
- if (log)
- log->Printf("ProcessGDBRemote::DoHalt() failed to stop after sending interrupt");
- error.SetErrorString ("Did not get stopped event after interrupt succeeded.");
- }
- else
- caused_stop = true;
- }
- else
+ if (!m_gdb_comm.SendInterrupt (locker, 2, &timed_out))
{
if (timed_out)
error.SetErrorString("timed out sending interrupt packet");
else
error.SetErrorString("unknown error sending interrupt packet");
}
-
- // Resume the private state thread at this point.
- ResumePrivateStateThread();
-
}
+ else
+ {
+ caused_stop = false;
+ }
+
return error;
}
@@ -1265,12 +1227,6 @@ ProcessGDBRemote::DoDestroy ()
return error;
}
-ByteOrder
-ProcessGDBRemote::GetByteOrder () const
-{
- return m_byte_order;
-}
-
//------------------------------------------------------------------
// Process Queries
//------------------------------------------------------------------
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 1e85e9918a7..546f1054536 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -90,10 +90,10 @@ public:
DidLaunch ();
virtual lldb_private::Error
- WillAttach (lldb::pid_t pid);
+ WillAttachToProcessWithID (lldb::pid_t pid);
virtual lldb_private::Error
- WillAttach (const char *process_name, bool wait_for_launch);
+ WillAttachToProcessWithName (const char *process_name, bool wait_for_launch);
lldb_private::Error
WillLaunchOrAttach ();
@@ -215,9 +215,6 @@ public:
virtual lldb_private::Error
DisableWatchpoint (lldb_private::WatchpointLocation *wp_loc);
- virtual lldb::ByteOrder
- GetByteOrder () const;
-
virtual lldb_private::DynamicLoader *
GetDynamicLoader ();
@@ -322,7 +319,6 @@ protected:
std::auto_ptr<lldb_private::DynamicLoader> m_dynamic_loader_ap;
lldb_private::Flags m_flags; // Process specific flags (see eFlags enums)
lldb_private::Mutex m_stdio_mutex; // Multithreaded protection for stdio
- lldb::ByteOrder m_byte_order;
GDBRemoteCommunication m_gdb_comm;
lldb::pid_t m_debugserver_pid;
lldb::thread_t m_debugserver_thread;
OpenPOWER on IntegriCloud