diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-03-03 21:40:51 -0800 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2023-03-06 13:14:15 -0800 |
| commit | cfe06f495beb520ab366957d1108bb80c7c92832 (patch) | |
| tree | 2ad8b08785c292381b4f3a832fe4a6be5ef91316 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp | |
| parent | 3c33d72e7fa83beb8a9b39fb3b8ecf4ee00c697d (diff) | |
[lldb/Plugin] Add breakpoint setting support to ScriptedProcesses.
This patch adds support for breakpoint setting to Scripted Processes.
For now, Scripted Processes only support setting software breakpoints.
When doing interactive scripted process debugging, it makes use of the
memory writing capability to write the trap opcodes in the memory of the
driving process. However the real process' target doesn't keep track of
the breakpoints that got added by the scripted process. This is a design
that we might need to change in the future, since we'll probably need to
do some book keeping to handle breakpoints that were set by different
scripted processes.
Differential Revision: https://reviews.llvm.org/D145296
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp index 79365f9b6975..c5a68271c75f 100644 --- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp @@ -267,6 +267,20 @@ size_t ScriptedProcess::DoWriteMemory(lldb::addr_t vm_addr, const void *buf, return bytes_written; } +Status ScriptedProcess::EnableBreakpointSite(BreakpointSite *bp_site) { + assert(bp_site != nullptr); + + if (bp_site->IsEnabled()) { + return {}; + } + + if (bp_site->HardwareRequired()) { + return Status("Scripted Processes don't support hardware breakpoints"); + } + + return EnableSoftwareBreakpoint(bp_site); +} + ArchSpec ScriptedProcess::GetArchitecture() { return GetTarget().GetArchitecture(); } |
