================
@@ -376,6 +382,147 @@ void Disassembler::PrintInstructions(Debugger &debugger, 
const ArchSpec &arch,
     }
   }
 
+  // Add variable location annotations to the disassembly output.
+  //
+  // For each instruction, this block attempts to resolve in-scope variables
+  // and determine if the current PC falls within their
+  // DWARF location entry. If so, it prints a simplified annotation using the
+  // variable name and its resolved location (e.g., "var = reg; " ).
+  //
+  // Annotations are only included if the variable has a valid DWARF location
+  // entry, and the location string is non-empty after filtering. Decoding
+  // errors and DWARF opcodes are intentionally omitted to keep the output
+  // concise and user-friendly.
+  //
+  // The goal is to give users helpful live variable hints alongside the
+  // disassembled instruction stream, similar to how debug information
+  // enhances source-level debugging.
----------------
JDevlieghere wrote:

This feels like it could be its own abstraction, like a small subclass in the 
disassembler file? Especially if there's state that needs to be shared. 

https://github.com/llvm/llvm-project/pull/152887
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to