diff options
author | Jason Molenda <jason@molenda.com> | 2023-08-07 15:16:47 -0700 |
---|---|---|
committer | Jason Molenda <jason@molenda.com> | 2023-08-07 15:19:45 -0700 |
commit | 57cbd26a68ab61631f5f4272d3c90df2eb0ce4f6 (patch) | |
tree | fe98961929173316c277e0e4222ea801cf6975fd /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | |
parent | 3e66a174dfd2144672cb7e23afb33df109abadd1 (diff) | |
download | llvm-57cbd26a68ab61631f5f4272d3c90df2eb0ce4f6.zip llvm-57cbd26a68ab61631f5f4272d3c90df2eb0ce4f6.tar.gz llvm-57cbd26a68ab61631f5f4272d3c90df2eb0ce4f6.tar.bz2 |
Flag for LoadBinaryWithUUIDAndAddress, to create memory image or not
DynamicLoader::LoadBinaryWithUUIDAndAddress can create a Module based
on the binary image in memory, which in some cases contains symbol
names and can be genuinely useful. If we don't have a filename, it
creates a name in the form `memory-image-0x...` with the header address.
In practice, this is most useful with Darwin userland corefiles
where the binary was stored in the corefile in whole, and we can't
find a binary with the matching UUID. Using the binary out of
the corefile memory in this case works well.
But in other cases, akin to firmware debugging, we merely end up
with an oddly named binary image and no symbols.
Add a flag to control whether we will create these memory images
and add them to the Target or not; only set it to true when working
with a userland Mach-O image with the "all image infos" LC_NOTE for
a userland corefile.
Differential Revision: https://reviews.llvm.org/D157167
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index b6f146f..e466ea2 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1001,10 +1001,11 @@ void ProcessGDBRemote::LoadStubBinaries() { const bool force_symbol_search = true; const bool notify = true; const bool set_address_in_target = true; + const bool allow_memory_image_last_resort = false; DynamicLoader::LoadBinaryWithUUIDAndAddress( this, "", standalone_uuid, standalone_value, standalone_value_is_offset, force_symbol_search, notify, - set_address_in_target); + set_address_in_target, allow_memory_image_last_resort); } } @@ -1033,10 +1034,12 @@ void ProcessGDBRemote::LoadStubBinaries() { const bool force_symbol_search = true; const bool set_address_in_target = true; + const bool allow_memory_image_last_resort = false; // Second manually load this binary into the Target. DynamicLoader::LoadBinaryWithUUIDAndAddress( this, llvm::StringRef(), uuid, addr, value_is_slide, - force_symbol_search, notify, set_address_in_target); + force_symbol_search, notify, set_address_in_target, + allow_memory_image_last_resort); } } } |