[Lldb-commits] [lldb] [lldb-dap] Show load addresses in disassembly (PR #136755)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 22 16:35:44 PDT 2025


================
@@ -148,10 +158,15 @@ bool SBInstructionList::GetDescription(Stream &sref) {
       const uint32_t max_opcode_byte_size =
           m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
       FormatEntity::Entry format;
-      FormatEntity::Parse("${addr}: ", format);
+      FormatEntity::Parse("${addr-file-or-load}: ", format);
       SymbolContext sc;
       SymbolContext prev_sc;
 
+      std::shared_ptr<ExecutionContext> exe_ctx_ptr;
+      if (nullptr != exe_ctx) {
+        exe_ctx_ptr = std::make_shared<ExecutionContext>(exe_ctx->get());
+      }
----------------
JDevlieghere wrote:

A few nits:

1. No braces around single-line ifs. 
2. Do we actually need to wrap this in a shared pointer? The underlying object will already live long enough, right? Anyway the current code doesn't look safe unless the underlying object inherits from `enable_shared_from_this`.

https://github.com/llvm/llvm-project/pull/136755


More information about the lldb-commits mailing list