forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb-dap] Mark hidden frames as "subtle" (llvm#105457)
This commit takes advantage of the recently introduced `SBFrame::IsHidden` to show those hidden frames as "subtle" frames in the UI. E.g., VS Code hides those stack frames by default, and renders them as grayed out frames, in case the user decides to show them in the stack trace
- Loading branch information
1 parent
a14c730
commit 6f45602
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
lldb/test/API/tools/lldb-dap/stackTrace/subtleFrames/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CXX_SOURCES := main.cpp | ||
|
||
include Makefile.rules |
29 changes: 29 additions & 0 deletions
29
lldb/test/API/tools/lldb-dap/stackTrace/subtleFrames/TestDAP_subtleFrames.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Test lldb-dap stack trace response | ||
""" | ||
|
||
|
||
import dap_server | ||
from lldbsuite.test.decorators import * | ||
|
||
import lldbdap_testcase | ||
from lldbsuite.test.lldbtest import * | ||
|
||
|
||
class TestDAP_subtleFrames(lldbdap_testcase.DAPTestCaseBase): | ||
@add_test_categories(["libc++"]) | ||
def test_subtleFrames(self): | ||
""" | ||
Internal stack frames (such as the ones used by `std::function`) are marked as "subtle". | ||
""" | ||
program = self.getBuildArtifact("a.out") | ||
self.build_and_launch(program) | ||
source = "main.cpp" | ||
self.set_source_breakpoints(source, [line_number(source, "BREAK HERE")]) | ||
self.continue_to_next_stop() | ||
|
||
frames = self.get_stackFrames() | ||
for f in frames: | ||
if "__function" in f["name"]: | ||
self.assertEqual(f["presentationHint"], "subtle") | ||
self.assertTrue(any(f.get("presentationHint") == "subtle" for f in frames)) |
13 changes: 13 additions & 0 deletions
13
lldb/test/API/tools/lldb-dap/stackTrace/subtleFrames/main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <functional> | ||
#include <iostream> | ||
|
||
void greet() { | ||
// BREAK HERE | ||
std::cout << "Hello\n"; | ||
} | ||
|
||
int main() { | ||
std::function<void()> func{greet}; | ||
func(); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters