[llvm] [Dexter][NFC] Add split step-data collection methods for DAP (PR #196350)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 01:02:18 PDT 2026
================
@@ -937,6 +937,70 @@ def _get_step_info(self, watches, step_index):
program_state=ProgramState(state_frames),
)
+ def get_stack_frames(self, step_index: int) -> StepIR:
+ """Returns a StepIR with stackframes and source locations (but no watched values)."""
+ assert (
+ not self._debugger_state.is_running
+ ), "Cannot get step info while debugger is running!"
+ trace_req_id = self.send_message(
+ self.make_request("stackTrace", {"threadId": self._debugger_state.thread})
+ )
+ trace_response = self._await_response(trace_req_id)
+ if not trace_response["success"]:
+ raise DebuggerException("failed to get stack frames")
+ stackframes = trace_response["body"]["stackFrames"]
+
+ frames = []
+
+ for stackframe in stackframes:
+ # No source, skip the frame! Currently I've only observed this for frames below main, so we break here; if
+ # it happens elsewhere, then this will break more stuff and we'll come up with a better solution.
----------------
OCHyams wrote:
will we know when that happens? can we verify/assert this by checking main is not the call stack? (and/or use `frames_below_main`?)
https://github.com/llvm/llvm-project/pull/196350
More information about the llvm-commits
mailing list