-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[lldb-dap] support moduleId in the stackTrace response #149774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,3 +242,29 @@ def test_StackFrameFormat(self): | |
|
||
frame = self.get_stackFrames(format={"parameters": False, "module": True})[0] | ||
self.assertEqual(frame["name"], "a.out recurse") | ||
|
||
def test_stackFrameModuleIdUUID(self): | ||
program = self.getBuildArtifact("a.out") | ||
self.build_and_launch(program) | ||
source = "main.c" | ||
|
||
self.set_source_breakpoints(source, [line_number(source, "recurse end")]) | ||
self.continue_to_next_stop() | ||
Comment on lines
+251
to
+252
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use |
||
|
||
modules = self.dap_server.get_modules() | ||
name_to_id = { | ||
name: info["id"] for name, info in modules.items() if "id" in info | ||
} | ||
|
||
stackFrames = self.get_stackFrames() | ||
for frame in stackFrames: | ||
module_id = frame.get("moduleId") | ||
source_name = frame.get("source", {}).get("name") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. source_name and module_id can be none, continue if it is none. |
||
|
||
if source_name in name_to_id: | ||
expected_id = name_to_id[source_name] | ||
self.assertEqual( | ||
module_id, | ||
expected_id, | ||
f"Expected moduleId '{expected_id}' for {source_name}, got: {module_id}", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.