|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
af91446a |
| 14-Apr-2022 |
Jonas Devlieghere <[email protected]> |
[lldb] Show the DBGError if dsymForUUID can't find a dSYM
Show the user the DBGError (if available) when dsymForUUID fails.
rdar://90949180
Differential revision: https://reviews.llvm.org/D123743
|
|
Revision tags: llvmorg-14.0.1 |
|
| #
9a8a0a38 |
| 24-Mar-2022 |
Jason Molenda <[email protected]> |
Load dyld manually with 'main bin spec' userland corefiles
In ProcessMachCore::DoLoadCore when we have a standalone binary and a 'main bin spec' LC_NOTE detailing the UUID and load address, ProcessM
Load dyld manually with 'main bin spec' userland corefiles
In ProcessMachCore::DoLoadCore when we have a standalone binary and a 'main bin spec' LC_NOTE detailing the UUID and load address, ProcessMachCore will do a (potentially slow) lookup to try to find the binary and/or dSYM. For kernel and userland corefile using 'main bin spec', we would follow the normal schemes of locating them. DynamicLoaderDarwinKernel would use the same (possibly expensive) calls to find the correct binary. dyld by default would use the in-core-file binary image, and so if the corefile didn't include the entire address space, the LINKEDIT for dyld could be missing. This means we can't find the dyld4::dyld_all_image_infos struct, which tells us where the other binaries are loaded in memory.
Treat userland 'bin main spec' like we do standalone firmewares; try the expensive checks to find the best dyld we can, before falling back to using a memory module out of the corefile.
Also add a little TODO for myself in this load_standalone_binary function that we should handle the case of a binary in the shared cache correctly, creating a memory module in the corefile and using the segment load addresses from that to set our segment load addresses for the final binary.
rdar://89717101
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
2937b282 |
| 01-Dec-2021 |
David Spickett <[email protected]> |
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.
Additional checks are added to fix the detection of the last mem
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 0df522969a7a0128052bd79182c8d58e00556e2f.
Additional checks are added to fix the detection of the last memory region in GetMemoryRegions or repeating the "memory region" command when the target has non-address bits.
Normally you keep reading from address 0, looking up each region's end address until you get LLDB_INVALID_ADDR as the region end address. (0xffffffffffffffff)
This is what the remote will return once you go beyond the last mapped region: [0x0000fffffffdf000-0x0001000000000000) rw- [stack] [0x0001000000000000-0xffffffffffffffff) ---
Problem is that when we "fix" the lookup address, we remove some bits from it. On an AArch64 system we have 48 bit virtual addresses, so when we fix the end address of the [stack] region the result is 0. So we loop back to the start.
[0x0000fffffffdf000-0x0001000000000000) rw- [stack] [0x0000000000000000-0x0000000000400000) ---
To fix this I added an additional check for the last range. If the end address of the region is different once you apply FixDataAddress, we are at the last region.
Since the end of the last region will be the last valid mappable address, plus 1. That 1 will be removed by the ABI plugin.
The only side effect is that on systems with non-address bits, you won't get that last catch all unmapped region from the max virtual address up to 0xf...f.
[0x0000fffff8000000-0x0000fffffffdf000) --- [0x0000fffffffdf000-0x0001000000000000) rw- [stack] <ends here>
Though in some way this is more correct because that region is not just unmapped, it's not mappable at all.
No extra testing is needed because this is already covered by TestMemoryRegion.py, I simply forgot to run it on system that had both top byte ignore and pointer authentication.
This change has been tested on a qemu VM with top byte ignore, memory tagging and pointer authentication enabled.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D115508
show more ...
|
| #
c34698a8 |
| 03-Feb-2022 |
Pavel Labath <[email protected]> |
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging inf
[lldb] Rename Logging.h to LLDBLog.h and clean up includes
Most of our code was including Log.h even though that is not where the "lldb" log channel is defined (Log.h defines the generic logging infrastructure). This worked because Log.h included Logging.h, even though it should.
After the recent refactor, it became impossible the two files include each other in this direction (the opposite inclusion is needed), so this patch removes the workaround that was put in place and cleans up all files to include the right thing. It also renames the file to LLDBLog to better reflect its purpose.
show more ...
|
| #
a007a6d8 |
| 31-Jan-2022 |
Pavel Labath <[email protected]> |
[lldb] Convert "LLDB" log channel to the new API
|
| #
682532ca |
| 22-Dec-2021 |
Jason Molenda <[email protected]> |
Support v2 of 'main bin spec' Mach-O LC_NOTE in corefiles
Version 2 of 'main bin spec' LC_NOTE allows for the specification of a slide of where the binary is loaded in the corefile virtual address s
Support v2 of 'main bin spec' Mach-O LC_NOTE in corefiles
Version 2 of 'main bin spec' LC_NOTE allows for the specification of a slide of where the binary is loaded in the corefile virtual address space. It also adds a (currently unused) platform field for the main binary.
Some corefile creators will only have a UUID and an offset to be applied to the binary.
Changed TestFirmwareCorefiles.py to test this new form of 'main bin spec' with a slide, and also to run on both x86_64 and arm64 macOS systems.
Differential Revision: https://reviews.llvm.org/D116094 rdar://85938455
show more ...
|
| #
0df52296 |
| 26-Nov-2021 |
David Spickett <[email protected]> |
Revert "Reland "[lldb] Remove non address bits when looking up memory regions""
This reverts commit fac3f20de55769d028bd92220e74f22fa57dd4b2.
I found this has broken how we detect the last memory r
Revert "Reland "[lldb] Remove non address bits when looking up memory regions""
This reverts commit fac3f20de55769d028bd92220e74f22fa57dd4b2.
I found this has broken how we detect the last memory region in GetMemoryRegions/"memory region" command.
When you're debugging an AArch64 system with pointer authentication, the ABI plugin will remove the top bit from the end address of the last user mapped area.
(lldb) [0x0000fffffffdf000-0x0001000000000000) rw- [stack]
ABI plugin removes anything above the 48th bit (48 bit virtual addresses by default on AArch64, leaving an address of 0.
(lldb) [0x0000000000000000-0x0000000000400000) ---
You get back a mapping for 0 and get into an infinite loop.
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1 |
|
| #
fac3f20d |
| 03-Nov-2021 |
David Spickett <[email protected]> |
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 5fbcf677347e38718461496d9e9e184a7a30c3fb.
ProcessDebugger is used in ProcessWindows and NativeProcessWindo
Reland "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 5fbcf677347e38718461496d9e9e184a7a30c3fb.
ProcessDebugger is used in ProcessWindows and NativeProcessWindows. I thought I was simplifying things by renaming to DoGetMemoryRegionInfo in ProcessDebugger but the Native process side expects "GetMemoryRegionInfo".
Follow the pattern that WriteMemory uses. So: * ProcessWindows::DoGetMemoryRegioninfo calls ProcessDebugger::GetMemoryRegionInfo * NativeProcessWindows::GetMemoryRegionInfo does the same
show more ...
|
| #
5fbcf677 |
| 03-Nov-2021 |
David Spickett <[email protected]> |
Revert "[lldb] Remove non address bits when looking up memory regions"
This reverts commit 6f5ce43b433706c3ae5c37022d6c0964b6bfadf8 due to build failure on Windows.
|
| #
6f5ce43b |
| 03-Nov-2021 |
David Spickett <[email protected]> |
[lldb] Remove non address bits when looking up memory regions
On AArch64 we have various things using the non address bits of pointers. This means when you lookup their containing region you won't f
[lldb] Remove non address bits when looking up memory regions
On AArch64 we have various things using the non address bits of pointers. This means when you lookup their containing region you won't find it if you don't remove them.
This changes Process GetMemoryRegionInfo to a non virtual method that uses the current ABI plugin to remove those bits. Then it calls DoGetMemoryRegionInfo.
That function does the actual work and is virtual to be overriden by Process implementations.
A test case is added that runs on AArch64 Linux using the top byte ignore feature.
Reviewed By: omjavaid
Differential Revision: https://reviews.llvm.org/D102757
show more ...
|
| #
5f4980f0 |
| 22-Oct-2021 |
Pavel Labath <[email protected]> |
[lldb] Remove ConstString from Process, ScriptInterpreter and StructuredData plugin names
|
| #
6fa1b4ff |
| 21-Oct-2021 |
Pavel Labath <[email protected]> |
Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names
|
| #
a3939e15 |
| 15-Oct-2021 |
Pavel Labath <[email protected]> |
[lldb] Return StringRef from PluginInterface::GetPluginName
There is no reason why this function should be returning a ConstString.
While modifying these files, I also fixed several instances where
[lldb] Return StringRef from PluginInterface::GetPluginName
There is no reason why this function should be returning a ConstString.
While modifying these files, I also fixed several instances where GetPluginName and GetPluginNameStatic were returning different strings.
I am not changing the return type of GetPluginNameStatic in this patch, as that would necessitate additional changes, and this patch is big enough as it is.
Differential Revision: https://reviews.llvm.org/D111877
show more ...
|
| #
62d91638 |
| 07-Oct-2021 |
Jason Molenda <[email protected]> |
Don't register mem segments that aren't present in a corefile
A Mach-O corefile has an array of memory segments, representing the memory of the process at the point of the capture. Each segment has
Don't register mem segments that aren't present in a corefile
A Mach-O corefile has an array of memory segments, representing the memory of the process at the point of the capture. Each segment has a virtual address + size, and a file offset + size. The file size may be less than the virtual address size, indicating that the memory was unavailable. When ProcessMachCore::DoLoadCore scans this array of memory segments, it builds up a table to translate virtual addresses to file offsets, for memory read requests. This lookup table combines contiguous memory segments into a single entry, to reduce the number of entries (some corefile writers will emit a separate segement for each virtual meory page).
This contiguous check wasn't taking into account a segment that isn't present in the corefile, e.g. filesize==0, and every contiguous memory segment after that point would result in lldb reading the wrong offset of the file because it didn't account for this.
I'd like to have an error message when someone tries to read memory from one of these segments, instead of returning all zeroes, so this patch intentionally leaves these out of the vmaddr -> fileoff table (and avoids combining them with segments that actually do exist in the corefile).
I'm a little unsure of writing a test for this one; I'd have to do a yaml2obj of a corefile with the problem, or add an internal mode to the Mach-O process save-core where it could write a filesize==0 segment while it was writing one.
rdar://83382487
show more ...
|
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3 |
|
| #
b0312676 |
| 10-Sep-2021 |
Pavel Labath <[email protected]> |
[lldb] Remove PluginInterface::GetPluginVersion
In all these years, we haven't found a use for this function (it has zero callers). Lets just remove the boilerplate.
Differential Revision: https://
[lldb] Remove PluginInterface::GetPluginVersion
In all these years, we haven't found a use for this function (it has zero callers). Lets just remove the boilerplate.
Differential Revision: https://reviews.llvm.org/D109600
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init |
|
| #
cdc6f8d7 |
| 22-Jul-2021 |
Jason Molenda <[email protected]> |
Read and write a LC_NOTE "addrable bits" for addressing mask
This patch adds code to process save-core for Mach-O files which embeds an "addrable bits" LC_NOTE when the process is using a code addre
Read and write a LC_NOTE "addrable bits" for addressing mask
This patch adds code to process save-core for Mach-O files which embeds an "addrable bits" LC_NOTE when the process is using a code address mask (e.g. AArch64 v8.3 with ptrauth aka arm64e). Add code to ObjectFileMachO to read that LC_NOTE from corefiles, and ProcessMachCore to set the process masks based on it when reading a corefile back in.
Also have "process status --verbose" print the current address masks that lldb is using internally to strip ptrauth bits off of addresses.
Differential Revision: https://reviews.llvm.org/D106348 rdar://68630113
show more ...
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
| #
9ea6dd5c |
| 20-Jun-2021 |
Jason Molenda <[email protected]> |
Add a corefile style option to process save-core; skinny corefiles
Add a new feature to process save-core on Darwin systems -- for lldb to create a user process corefile with only the dirty (modifie
Add a corefile style option to process save-core; skinny corefiles
Add a new feature to process save-core on Darwin systems -- for lldb to create a user process corefile with only the dirty (modified memory) pages included. All of the binaries that were used in the corefile are assumed to still exist on the system for the duration of the use of the corefile. A new --style option to process save-core is added, so a full corefile can be requested if portability across systems, or across time, is needed for this corefile.
debugserver can now identify the dirty pages in a memory region when queried with qMemoryRegionInfo, and the size of vm pages is given in qHostInfo.
Create a new "all image infos" LC_NOTE for Mach-O which allows us to describe all of the binaries that were loaded in the process -- load address, UUID, file path, segment load addresses, and optionally whether code from the binary was executing on any thread. The old "read dyld_all_image_infos and then the in-memory Mach-O load commands to get segment load addresses" no longer works when we only have dirty memory.
rdar://69670807 Differential Revision: https://reviews.llvm.org/D88387
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc2 |
|
| #
76e47d48 |
| 26-May-2021 |
Raphael Isemann <[email protected]> |
[lldb][NFC] Use C++ versions of the deprecated C standard library headers
The C headers are deprecated so as requested in D102845, this is replacing them all with their (not deprecated) C++ equivale
[lldb][NFC] Use C++ versions of the deprecated C standard library headers
The C headers are deprecated so as requested in D102845, this is replacing them all with their (not deprecated) C++ equivalent.
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D103084
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5 |
|
| #
78a14128 |
| 02-Apr-2021 |
Jason Molenda <[email protected]> |
Handle all standalone combinations of LC_NOTEs w/ & w/o addr & uuid
Fill out ProcessMachCore::DoLoadCore to handle LC_NOTE hints with a UUID or with a UUID+address, and load the binary at the specif
Handle all standalone combinations of LC_NOTEs w/ & w/o addr & uuid
Fill out ProcessMachCore::DoLoadCore to handle LC_NOTE hints with a UUID or with a UUID+address, and load the binary at the specified offset correctly. Add tests for all four combinations. Change DynamicLoaderStatic to not re-set a Section's load address in the Target if it's already been specified.
Differential Revision: https://reviews.llvm.org/D99571 rdar://51490545
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc4 |
|
| #
3bc65a94 |
| 24-Mar-2021 |
Jason Molenda <[email protected]> |
Handle a LC_NOTE main bin spec for user process corefiles
I was playing around with main bin spec LC_NOTEs and noticed a small oversight in the parsing of user process corefile notes.
|
|
Revision tags: llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init |
|
| #
4bb62448 |
| 22-Jan-2021 |
Walter Erquinigo <[email protected]> |
[ThreadPlan] fix exec on Linux
|
|
Revision tags: llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
| #
18e4272a |
| 20-Nov-2020 |
Michał Górny <[email protected]> |
[lldb] Prevent 'process connect' from using local-only plugins
Add a 'can_connect' parameter to Process plugin initialization, and use it to filter plugins to these capable of remote connections. T
[lldb] Prevent 'process connect' from using local-only plugins
Add a 'can_connect' parameter to Process plugin initialization, and use it to filter plugins to these capable of remote connections. This is used to prevent 'process connect' from picking up a plugin that can only be used locally, e.g. the legacy FreeBSD plugin.
Differential Revision: https://reviews.llvm.org/D91810
show more ...
|
| #
fb19f11e |
| 27-Oct-2020 |
Walter Erquinigo <[email protected]> |
[trace][intel-pt] Scaffold the 'thread trace start | stop' commands
Depends on D90490.
The stop command is simple and invokes the new method Trace::StopTracingThread(thread).
On the other hand, th
[trace][intel-pt] Scaffold the 'thread trace start | stop' commands
Depends on D90490.
The stop command is simple and invokes the new method Trace::StopTracingThread(thread).
On the other hand, the start command works by delegating its implementation to a CommandObject provided by the Trace plugin. This is necessary because each trace plugin needs different options for this command. There's even the chance that a Trace plugin can't support live tracing, but instead supports offline decoding and analysis, which means that "thread trace dump instructions" works but "thread trace start" doest. Because of this and a few other reasons, it's better to have each plugin provide this implementation.
Besides, I'm using the GetSupportedTraceType method introduced in D90490 to quickly infer what's the trace plug-in that works for the current process.
As an implementation note, I moved CommandObjectIterateOverThreads to its header so that I can use it from the IntelPT plugin. Besides, the actual start and stop logic for intel-pt is not part of this diff.
Reviewed By: clayborg
Differential Revision: https://reviews.llvm.org/D90729
show more ...
|
|
Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5 |
|
| #
6e54918d |
| 28-Sep-2020 |
Jason Molenda <[email protected]> |
Once we've found a firmware binary and loaded it, don't search more
Add the flag in ProcessMachCore::DoLoadCore that stops additional searches for the binaries when we have an LC_NOTE identifying th
Once we've found a firmware binary and loaded it, don't search more
Add the flag in ProcessMachCore::DoLoadCore that stops additional searches for the binaries when we have an LC_NOTE identifying the firmware/standalone binary as the correct one & we have loaded it successfully.
show more ...
|
|
Revision tags: llvmorg-11.0.0-rc4 |
|
| #
1bec6eb3 |
| 25-Sep-2020 |
Jason Molenda <[email protected]> |
Add support for firmware/standalone LC_NOTE "main bin spec" corefiles
When a Mach-O corefile has an LC_NOTE "main bin spec" for a standalone binary / firmware, with only a UUID and no load address,
Add support for firmware/standalone LC_NOTE "main bin spec" corefiles
When a Mach-O corefile has an LC_NOTE "main bin spec" for a standalone binary / firmware, with only a UUID and no load address, try to locate the binary and dSYM by UUID and if found, load it at offset 0 for the user.
Add a test case that tests a firmware/standalone corefile with both the "kern ver str" and "main bin spec" LC_NOTEs.
<rdar://problem/68193804>
Differential Revision: https://reviews.llvm.org/D88282
show more ...
|