[Lldb-commits] [PATCH] D109777: [lldb] [Windows] Fix continuing from breakpoints and singlestepping on ARM/AArch64

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 17 05:07:50 PDT 2021


mstorsjo added inline comments.


================
Comment at: lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp:495-514
+        int breakpoint_size = 1;
+        switch (GetArchitecture().GetMachine()) {
+        case llvm::Triple::aarch64:
+          breakpoint_size = 4;
+          break;
+
+        case llvm::Triple::arm:
----------------
labath wrote:
> This should be the job of `GetSoftwareBreakpointPCOffset`, although the default implementation of that function returns zero for arm. If that is not desired (does windows automatically increment the PC or something?), then I guess you should override that function.
Thanks for the pointer - I checked and it does indeed seem to be the case that Windows stops with the PC register incremented when hitting breakpoints, so it's straightforward to override `GetSoftwareBreakpointPCOffset` here and use that.

Unfortunately, for the case in ProcessWindows.cpp, it doesn't seem to be as straightforward to use that (or anything else based on `GetSoftwareBreakpointTrapOpcode`) as the Process/Platform versions of `GetSoftwareBreakpointTrapOpcode` also need a `BreakpointSite` where the opcode actually is set.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109777/new/

https://reviews.llvm.org/D109777



More information about the lldb-commits mailing list