diff options
author | Greg Clayton <gclayton@apple.com> | 2013-05-21 01:00:52 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-05-21 01:00:52 +0000 |
commit | 15fc2be75ba8c1276a0704380a07a4d377c1ef76 (patch) | |
tree | 0b3f977c5c6954a3d51258a76aa050cd334f9b2b /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 9d4c735885bfc5a6d5300ed2cd58e3b42f0637fd (diff) | |
download | bcm5719-llvm-15fc2be75ba8c1276a0704380a07a4d377c1ef76.tar.gz bcm5719-llvm-15fc2be75ba8c1276a0704380a07a4d377c1ef76.zip |
<rdar://problem/13892516>
LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin).
llvm-svn: 182345
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index ff698be909b..ce1fd8dcae1 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1011,7 +1011,6 @@ ProcessGDBRemote::DoDidExec () // The process exec'ed itself, figure out the dynamic loader, etc... BuildDynamicRegisterInfo (true); m_gdb_comm.ResetDiscoverableSettings(); - DidLaunchOrAttach (); } @@ -1350,7 +1349,20 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) case 'T': case 'S': { - if (GetStopID() == 0) + // This is a bit of a hack, but is is required. If we did exec, we + // need to clear our thread lists and also know to rebuild our dynamic + // register info before we lookup and threads and populate the expedited + // register values so we need to know this right away so we can cleanup + // and update our registers. + const bool did_exec = stop_packet.GetStringRef().find(";reason:exec;") != std::string::npos; + + if (did_exec) + { + m_thread_list_real.Clear(); + m_thread_list.Clear(); + } + + if (GetStopID() == 0 || did_exec) { // Our first stop, make sure we have a process ID, and also make // sure we know about our registers @@ -1552,9 +1564,14 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithException(*thread_sp, description.c_str())); handled = true; } + else if (reason.compare("exec") == 0) + { + thread_sp->SetStopInfo (StopInfo::CreateStopReasonWithExec(*thread_sp)); + handled = true; + } } - if (signo) + if (signo && did_exec == false) { if (signo == SIGTRAP) { |