aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorJason Molenda <jason@molenda.com>2023-05-30 15:13:36 -0700
committerJason Molenda <jason@molenda.com>2023-05-30 15:36:40 -0700
commit48a12ae8212c22d9d1d84270db659ac76ecfa972 (patch)
tree32d21a833c35ca8699f3afb2a744954152fc663a /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parentc7eb1b07470b9babfcd258f014df3661e5f84b30 (diff)
downloadllvm-48a12ae8212c22d9d1d84270db659ac76ecfa972.zip
llvm-48a12ae8212c22d9d1d84270db659ac76ecfa972.tar.gz
llvm-48a12ae8212c22d9d1d84270db659ac76ecfa972.tar.bz2
Fix a few bugs with Mach-O corefile loading, plus perf
In ProcessMachCore::LoadBinariesViaMetadata(), if we did load some binaries via metadata in the core file, don't then search for a userland dyld in the corefile / kernel and throw away that binary list. Also fix a little bug with correctly recognizing corefiles using a `main bin spec` LC_NOTE that explicitly declare that this is a userland corefile. LocateSymbolFileMacOSX.cpp's Symbols::DownloadObjectAndSymbolFile clarify the comments on how the force_lookup and how the dbgshell_command local both have the same effect. In PlatformDarwinKernel::LoadPlatformBinaryAndSetup, don't log a message unless we actually found a kernel fileset. Reorganize ObjectFileMachO::LoadCoreFileImages so that it delegates binary searching to DynamicLoader::LoadBinaryWithUUIDAndAddress and doesn't duplicate those searches. For searches that fail, we would perform them multiple times in both methods. When we have the mach-o segment vmaddrs for a binary, don't let LoadBinaryWithUUIDAndAddress load the binary first at its mach-o header address in the Target; we'll load the segments at the correct addresses individually later in this method. DynamicLoaderDarwin::ImageInfo::PutToLog fix a LLDB_LOG logging formatter. In DynamicLoader::LoadBinaryWithUUIDAndAddress, instead of using Target::GetOrCreateModule as a way to find a binary already registered in lldb's global module cache (and implicitly add it to the Target image list), use ModuleList::GetSharedModule() which only searches the global module cache, don't add it to the Target. We may not want to add an unstripped binary to the Target. Add a call to Symbols::DownloadObjectAndSymbolFile() even if "force_symbol_search" isn't set -- this will turn into a DebugSymbols call / Spotlight search on a macOS system, which we want. Only set the Module's LoadAddress if the caller asked us to do that. Differential Revision: https://reviews.llvm.org/D150928 rdar://109186357
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index d20a022..23b9cfd 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -995,9 +995,11 @@ void ProcessGDBRemote::LoadStubBinaries() {
if (standalone_uuid.IsValid()) {
const bool force_symbol_search = true;
const bool notify = true;
+ const bool set_address_in_target = true;
DynamicLoader::LoadBinaryWithUUIDAndAddress(
this, "", standalone_uuid, standalone_value,
- standalone_value_is_offset, force_symbol_search, notify);
+ standalone_value_is_offset, force_symbol_search, notify,
+ set_address_in_target);
}
}
@@ -1025,10 +1027,11 @@ void ProcessGDBRemote::LoadStubBinaries() {
continue;
const bool force_symbol_search = true;
+ const bool set_address_in_target = true;
// Second manually load this binary into the Target.
- DynamicLoader::LoadBinaryWithUUIDAndAddress(this, llvm::StringRef(), uuid,
- addr, value_is_slide,
- force_symbol_search, notify);
+ DynamicLoader::LoadBinaryWithUUIDAndAddress(
+ this, llvm::StringRef(), uuid, addr, value_is_slide,
+ force_symbol_search, notify, set_address_in_target);
}
}
}