Skip to content

Commit

Permalink
[lldb-dap] Include [opt] in the frame name only if a custom frame for…
Browse files Browse the repository at this point in the history
…mat 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)
  • Loading branch information
walter-erquinigo authored and adrian-prantl committed Jan 19, 2024
1 parent e0e14be commit 42ee7f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lldb/tools/lldb-dap/JSONUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,11 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
llvm::raw_string_ostream os(frame_name);
os << llvm::format_hex(frame.GetPC(), 18);
}
bool is_optimized = frame.GetFunction().GetIsOptimized();
if (is_optimized)

// We only include `[opt]` if a custom frame format is not specified.
if (!g_dap.frame_format && frame.GetFunction().GetIsOptimized())
frame_name += " [opt]";

EmplaceSafeString(object, "name", frame_name);

auto source = CreateSource(frame);
Expand Down

0 comments on commit 42ee7f7

Please sign in to comment.