llvm-project/lldb/bindings/python
Med Ismail Bennani a758c9f720 [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 <medismail.bennani@gmail.com>
2021-10-08 14:54:07 +02:00
..
CMakeLists.txt Revert "[lldb/Plugins] Add ScriptedProcess Process Plugin" 2021-03-24 21:31:16 +01:00
createPythonInit.py
python-extensions.swig [lldb][docs] Cleanup the Python doc strings for SB API classes 2021-01-17 16:51:07 +01:00
python-swigsafecast.swig Revert "Revert "Add the ability to write target stop-hooks using the ScriptInterpreter."" 2020-09-29 12:01:14 -07:00
python-typemaps.h Move Py_buffer_RAII to .h file so SWIG 2 doesnt have to parse it 2020-08-22 10:43:50 -07:00
python-typemaps.swig Move Py_buffer_RAII to .h file so SWIG 2 doesnt have to parse it 2020-08-22 10:43:50 -07:00
python-wrapper.swig [lldb/Plugins] Add memory region support in ScriptedProcess 2021-10-08 14:54:07 +02:00
python.swig [lldb][docs] Add a doc page for enums and constants 2021-01-19 18:54:05 +01:00