diff options
author | Greg Clayton <gclayton@apple.com> | 2011-02-15 00:19:15 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-02-15 00:19:15 +0000 |
commit | e576ab2996b5fa4facf2bf7e73cc4679cb17c133 (patch) | |
tree | bdcafd5e6a9f09adf5a3e9d3b7e92f9d693b939c /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 91c08ad14a81cc40769442c19a23addfba28371e (diff) | |
download | bcm5719-llvm-e576ab2996b5fa4facf2bf7e73cc4679cb17c133.tar.gz bcm5719-llvm-e576ab2996b5fa4facf2bf7e73cc4679cb17c133.zip |
All UnwindPlan objects are now passed around as shared pointers.
ArchDefaultUnwindPlan plug-in interfaces are now cached per architecture
instead of being leaked for every frame.
Split the ArchDefaultUnwindPlan_x86 into ArchDefaultUnwindPlan_x86_64 and
ArchDefaultUnwindPlan_i386 interfaces.
There were sporadic crashes that were due to something leaking or being
destroyed when doing stack crawls. This patch should clear up these issues.
llvm-svn: 125541
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 87bc0b9a67f..cee2d3d1dee 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -642,7 +642,6 @@ ProcessGDBRemote::DidLaunchOrAttach () StreamString strm; - ; // 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(); @@ -1176,6 +1175,18 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) case 'T': case 'S': { + if (GetStopID() == 0) + { + // Our first stop, make sure we have a process ID, and also make + // sure we know about our registers + if (GetID() == LLDB_INVALID_PROCESS_ID) + { + lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID (1); + if (pid != LLDB_INVALID_PROCESS_ID) + SetID (pid); + } + BuildDynamicRegisterInfo (true); + } // Stop with signal and thread info const uint8_t signo = stop_packet.GetHexU8(); std::string name; @@ -1209,7 +1220,14 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) { // thread in big endian hex tid = Args::StringToUInt32 (value.c_str(), 0, 16); + Mutex::Locker locker (m_thread_list.GetMutex ()); thread_sp = m_thread_list.FindThreadByID(tid, false); + if (!thread_sp) + { + // Create the thread if we need to + thread_sp.reset (new ThreadGDBRemote (*this, tid)); + m_thread_list.AddThread(thread_sp); + } } else if (name.compare("hexname") == 0) { @@ -1242,7 +1260,15 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) StringExtractor reg_value_extractor; // Swap "value" over into "reg_value_extractor" reg_value_extractor.GetStringRef().swap(value); - static_cast<ThreadGDBRemote *> (thread_sp.get())->PrivateSetRegisterValue (reg, reg_value_extractor); + if (!static_cast<ThreadGDBRemote *> (thread_sp.get())->PrivateSetRegisterValue (reg, reg_value_extractor)) + { + Host::SetCrashDescriptionWithFormat("Setting thread register '%s' (decoded to %u (0x%x)) with value '%s' for stop packet: '%s'", + name.c_str(), + reg, + reg, + reg_value_extractor.GetStringRef().c_str(), + stop_packet.GetStringRef().c_str()); + } } } } |