Skip to content

Commit 07ed325

Browse files
[lldb-dap] Include [opt] in the frame name only if a custom frame format is not specified. (#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.
1 parent 10f15e2 commit 07ed325

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
@@ -804,9 +804,11 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
804804
llvm::raw_string_ostream os(frame_name);
805805
os << llvm::format_hex(frame.GetPC(), 18);
806806
}
807-
bool is_optimized = frame.GetFunction().GetIsOptimized();
808-
if (is_optimized)
807+
808+
// We only include `[opt]` if a custom frame format is not specified.
809+
if (!g_dap.frame_format && frame.GetFunction().GetIsOptimized())
809810
frame_name += " [opt]";
811+
810812
EmplaceSafeString(object, "name", frame_name);
811813

812814
auto source = CreateSource(frame);

0 commit comments

Comments
 (0)