Skip to content

Commit 42ee7f7

Browse files
walter-erquinigoadrian-prantl
authored andcommitted
[lldb-dap] Include [opt] in the frame name only if a custom frame format is not specified. (llvm#74861)
Currently there's an include in which `[opt]` might be emitted twice if the frame format also asks for it. As a trivial fix, we should manually emit `[opt]` only if a custom frame format is not specified. (cherry picked from commit 07ed325)
1 parent e0e14be commit 42ee7f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lldb/tools/lldb-dap/JSONUtils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,11 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
798798
llvm::raw_string_ostream os(frame_name);
799799
os << llvm::format_hex(frame.GetPC(), 18);
800800
}
801-
bool is_optimized = frame.GetFunction().GetIsOptimized();
802-
if (is_optimized)
801+
802+
// We only include `[opt]` if a custom frame format is not specified.
803+
if (!g_dap.frame_format && frame.GetFunction().GetIsOptimized())
803804
frame_name += " [opt]";
805+
804806
EmplaceSafeString(object, "name", frame_name);
805807

806808
auto source = CreateSource(frame);

0 commit comments

Comments
 (0)