|
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, llvmorg-14.0.1 |
|
| #
150db43e |
| 25-Mar-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugin] Sort the ScriptedProcess' thread list before creating threads
With Scripted Processes, in order to create scripted threads, the blueprint provides a dictionary that have each thread in
[lldb/Plugin] Sort the ScriptedProcess' thread list before creating threads
With Scripted Processes, in order to create scripted threads, the blueprint provides a dictionary that have each thread index as the key with the respective thread instance as the pair value.
In Python, this is fine because a dictionary key can be of any type including integer types:
``` >>> {1: "one", 2: "two", 10: "ten"} {1: 'one', 2: 'two', 10: 'ten'} ```
However, when the python dictionary gets bridged to C++ we convert it to a `StructuredData::Dictionary` that uses a `std::map<ConstString, ObjectSP>` for storage.
Because `std::map` is an ordered container and ours uses the `ConstString` type for keys, the thread indices gets converted to strings which makes the dictionary sorted alphabetically, instead of numerically.
If the ScriptedProcess has 10 threads or more, it causes thread “10” (and higher) to be after thread “1”, but before thread “2”.
In order to solve this, this sorts the thread info dictionary keys numerically, before iterating over them to create ScriptedThreads.
rdar://90327854
Differential Revision: https://reviews.llvm.org/D122429
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3 |
|
| #
680ca7f2 |
| 04-Mar-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Add ability to load modules to Scripted Processes
This patch introduces a new way to load modules programatically with Scripted Processes. To do so, the scripted process blueprint hol
[lldb/Plugins] Add ability to load modules to Scripted Processes
This patch introduces a new way to load modules programatically with Scripted Processes. To do so, the scripted process blueprint holds a list of dictionary describing the modules to load, which their path or uuid, load address and eventually a slide offset.
LLDB will fetch that list after launching the ScriptedProcess, and iterate over each entry to create the module that will be loaded in the Scripted Process' target.
The patch also refactors the StackCoreScriptedProcess test to stop inside the `libbaz` module and make sure it's loaded correctly and that we can fetch some variables from it.
rdar://74520238
Differential Revision: https://reviews.llvm.org/D120969
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2 |
|
| #
7c54ffdc |
| 16-Feb-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/crashlog] Add CrashLogScriptedProcess & remove interactive mode
This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess. It takes advantage of lldb's crashlog parsers and
[lldb/crashlog] Add CrashLogScriptedProcess & remove interactive mode
This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess. It takes advantage of lldb's crashlog parsers and Scripted Processes to reconstruct a static debugging session with symbolicated stackframes, instead of just dumping out everything in the user's terminal.
The crashlog command also has an interactive mode that only provide a very limited experience. This is why this patch removes all the logic for this interactive mode and creates CrashLogScriptedProcess instead.
This will fetch and load all the libraries that were used by the crashed thread and re-create all the frames artificially.
rdar://88721117
Differential Revision: https://reviews.llvm.org/D119501
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
70665844 |
| 10-Feb-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugin] Add artificial stackframe loading in ScriptedThread
This patch adds the ability for ScriptedThread to load artificial stack frames. To do so, the interpreter instance can create a list
[lldb/Plugin] Add artificial stackframe loading in ScriptedThread
This patch adds the ability for ScriptedThread to load artificial stack frames. To do so, the interpreter instance can create a list that will contain the frame index and its pc address.
Then, when the Scripted Process plugin stops, it will refresh its Scripted Threads state by invalidating their register context and load to list from the interpreter object and reconstruct each frame.
This patch also removes all of the default implementation for `get_stackframes` from the derived ScriptedThread classes, and add the interface code for the Scripted Thread Interface.
rdar://88721095
Differential Revision: https://reviews.llvm.org/D119388
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
|
Revision tags: 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
|
| #
91bb1161 |
| 18-Jan-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Interpreter] Make `ScriptedInterface::ErrorWithMessage` static (NFC)
This patch changes the `ScriptedInterface::ErrorWithMessage` method to make it `static` which makes it easier to call.
The
[lldb/Interpreter] Make `ScriptedInterface::ErrorWithMessage` static (NFC)
This patch changes the `ScriptedInterface::ErrorWithMessage` method to make it `static` which makes it easier to call.
The patch also updates its various call sites to reflect this change.
Differential Revision: https://reviews.llvm.org/D117374
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
45148bfe |
| 18-Jan-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Fix ScriptedThread IndexID reporting
When listing all the Scripted Threads of a ScriptedProcess, we can see that all have the thread index set to 1. This is caused by the lldb_private
[lldb/Plugins] Fix ScriptedThread IndexID reporting
When listing all the Scripted Threads of a ScriptedProcess, we can see that all have the thread index set to 1. This is caused by the lldb_private::Thread constructor, which sets the m_index_id member using the provided thread id `tid`.
Because the call to the super constructor is done before instantiating the `ScriptedThreadInterface`, lldb can't fetch the thread id from the script instance, so it uses `LLDB_INVALID_THREAD_ID` instead.
To mitigate this, this patch takes advantage of the `ScriptedThread::Create` fallible constructor idiom to defer calling the `ScriptedThread` constructor (and the `Thread` super constructor with it), until we can fetch a valid thread id `tid` from the `ScriptedThreadInterface`.
rdar://87432065
Differential Revision: https://reviews.llvm.org/D117076
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
cfa55bfe |
| 18-Jan-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Enrich ScriptedThreads Stop Reasons with Exceptions
This patch adds Exceptions to the list of supported stop reasons for Scripted Threads.
The main motivation for this is that breakp
[lldb/Plugins] Enrich ScriptedThreads Stop Reasons with Exceptions
This patch adds Exceptions to the list of supported stop reasons for Scripted Threads.
The main motivation for this is that breakpoints are triggered as a special exception class on ARM platforms, so adding it as a stop reason allows the ScriptedProcess to selected the ScriptedThread that stopped at a breakpoint (or crashed :p).
rdar://87430376
Differential Revision: https://reviews.llvm.org/D117074
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
d3e0f7e1 |
| 18-Jan-2022 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Add support of multiple ScriptedThreads in a ScriptedProcess
This patch adds support of multiple Scripted Threads in a ScriptedProcess.
This is done by fetching the Scripted Threads
[lldb/Plugins] Add support of multiple ScriptedThreads in a ScriptedProcess
This patch adds support of multiple Scripted Threads in a ScriptedProcess.
This is done by fetching the Scripted Threads info dictionary at every ScriptedProcess::DoUpdateThreadList and iterate over each element to create a new ScriptedThread using the object instance, if it was not already available.
This patch also adds the ability to pass a pointer of a script interpreter object instance to initialize a ScriptedInterface instead of having to call the script object initializer in the ScriptedInterface constructor.
This is used to instantiate the ScriptedThreadInterface from the ScriptedThread constructor, to be able to perform call on that script interpreter object instance.
Finally, the patch also updates the scripted process test to check for multiple threads.
rdar://84507704
Differential Revision: https://reviews.llvm.org/D117071
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
caea440a |
| 02-Dec-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/plugins] Add arm64(e) support to ScriptedProcess
This patch adds support for arm64(e) targets to ScriptedProcess, by providing the `DynamicRegisterInfo` to the base `lldb.ScriptedThread` class
[lldb/plugins] Add arm64(e) support to ScriptedProcess
This patch adds support for arm64(e) targets to ScriptedProcess, by providing the `DynamicRegisterInfo` to the base `lldb.ScriptedThread` class. This allows create and debugging ScriptedProcess on Apple Silicon hardware as well as Apple mobile devices.
It also replace the C++ asserts on `ScriptedThread::GetDynamicRegisterInfo` by some error logging, re-enables `TestScriptedProcess` for arm64 Darwin platforms and adds a new invalid Scripted Thread test.
rdar://85892451
Differential Revision: https://reviews.llvm.org/D114923
Signed-off-by: Med Ismail Bennani <[email protected]>
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 |
|
| #
676576b6 |
| 10-Nov-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Refactor ScriptedThread register context creation
This patch changes the ScriptedThread class to create the register context when Process::RefreshStateAfterStop is called rather than
[lldb/Plugins] Refactor ScriptedThread register context creation
This patch changes the ScriptedThread class to create the register context when Process::RefreshStateAfterStop is called rather than doing it in the thread constructor.
This is required to update the thread state for execution control.
Differential Revision: https://reviews.llvm.org/D112167
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
ad0f7d3d |
| 10-Nov-2021 |
Med Ismail Bennani <[email protected]> |
[lldb] Fix Scripted ProcessLaunchInfo Argument nullptr deref
This patch adds a new `StructuredData::Dictionary` constructor that takes a `StructuredData::ObjectSP` as an argument. This is used to pa
[lldb] Fix Scripted ProcessLaunchInfo Argument nullptr deref
This patch adds a new `StructuredData::Dictionary` constructor that takes a `StructuredData::ObjectSP` as an argument. This is used to pass the opaque_ptr from the `SBStructuredData` used to initialize a ScriptedProecss, to the `ProcessLaunchInfo` class.
This also updates `SBLaunchInfo::SetScriptedProcessDictionary` to reflect the formentionned changes which solves the nullptr deref.
Differential Revision: https://reviews.llvm.org/D112107
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
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
|
| #
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 ...
|
| #
88a941ba |
| 08-Oct-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Replace platform-specific macro with LLVM_PRETTY_FUNCTION (NFC)
This patch refactors Scripted Process and Scripted Thread related classes to use LLVM_PRETTY_FUNCTION instead of the co
[lldb/Plugins] Replace platform-specific macro with LLVM_PRETTY_FUNCTION (NFC)
This patch refactors Scripted Process and Scripted Thread related classes to use LLVM_PRETTY_FUNCTION instead of the compiler macro.
Differential Revision: https://reviews.llvm.org/D111452
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
a758c9f7 |
| 08-Oct-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Add memory region support in ScriptedProcess
This patch adds support for memory regions in Scripted Processes. This is necessary to read the stack memory region in order to reconstruc
[lldb/Plugins] Add memory region support in ScriptedProcess
This patch adds support for memory regions in Scripted Processes. This is necessary to read the stack memory region in order to reconstruct each stackframe of the program.
In order to do so, this patch makes some changes to the SBAPI, namely: - Add a new constructor for `SBMemoryRegionInfo` that takes arguments such as the memory region name, address range, permissions ... This is used when reading memory at some address to compute the offset in the binary blob provided by the user. - Add a `GetMemoryRegionContainingAddress` method to `SBMemoryRegionInfoList` to simplify the access to a specific memory region.
With these changes, lldb is now able to unwind the stack and reconstruct each frame. On top of that, reloading the target module at offset 0 allows lldb to symbolicate the `ScriptedProcess` using debug info, similarly to an ordinary Process.
To test this, I wrote a simple program with multiple function calls, ran it in lldb, stopped at a leaf function and read the registers values and copied the stack memory into a binary file. These are then used in the python script.
Differential Revision: https://reviews.llvm.org/D108953
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|
| #
59d8dd79 |
| 06-Oct-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Add support for ScriptedThread in ScriptedProcess
This patch introduces the `ScriptedThread` class with its python interface.
When used with `ScriptedProcess`, `ScriptedThreaad` can
[lldb/Plugins] Add support for ScriptedThread in ScriptedProcess
This patch introduces the `ScriptedThread` class with its python interface.
When used with `ScriptedProcess`, `ScriptedThreaad` can provide various information such as the thread state, stop reason or even its register context.
This can be used to reconstruct the program stack frames using lldb's unwinder.
rdar://74503836
Differential Revision: https://reviews.llvm.org/D107585
Signed-off-by: Med Ismail Bennani <[email protected]>
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 ...
|
| #
3925204c |
| 03-Sep-2021 |
Med Ismail Bennani <[email protected]> |
[lldb/Plugins] Introduce Scripted Interface Factory
This patch splits the previous `ScriptedProcessPythonInterface` into multiple specific classes:
1. The `ScriptedInterface` abstract class that ca
[lldb/Plugins] Introduce Scripted Interface Factory
This patch splits the previous `ScriptedProcessPythonInterface` into multiple specific classes:
1. The `ScriptedInterface` abstract class that carries the interface instance object and its virtual pure abstract creation method.
2. The `ScriptedPythonInterface` that holds a generic `Dispatch` method that can be used by various interfaces to call python methods and also keeps a reference to the Python Script Interpreter instance.
3. The `ScriptedProcessInterface` that describes the base Scripted Process model with all the methods used in the underlying script.
All these components are used to refactor the `ScriptedProcessPythonInterface` class, making it more modular.
This patch is also a requirement for the upcoming work on `ScriptedThread`.
Differential Revision: https://reviews.llvm.org/D107521
Signed-off-by: Med Ismail Bennani <[email protected]>
show more ...
|