aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools
diff options
context:
space:
mode:
authorWalter Erquinigo <a20012251@gmail.com>2023-12-11 14:46:25 -0500
committerGitHub <noreply@github.com>2023-12-11 14:46:25 -0500
commit07ed3258d0b38bdfd60c203c23a59c8ce8def914 (patch)
treef5a75bf0693bca37d9287c634b16dec751793911 /lldb/tools
parent10f15e2ec419328aa35292b64721e1e1e9e37d70 (diff)
downloadllvm-07ed3258d0b38bdfd60c203c23a59c8ce8def914.zip
llvm-07ed3258d0b38bdfd60c203c23a59c8ce8def914.tar.gz
llvm-07ed3258d0b38bdfd60c203c23a59c8ce8def914.tar.bz2
[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.
Diffstat (limited to 'lldb/tools')
-rw-r--r--lldb/tools/lldb-dap/JSONUtils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp b/lldb/tools/lldb-dap/JSONUtils.cpp
index 3a63046..62d7fa5 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -804,9 +804,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);