================
@@ -574,16 +589,39 @@ class VariableAnnotator {
     std::string name;
     /// Last printed location (empty means <undef>).
     std::string last_loc;
+    /// Address range where this variable state is valid.
+    lldb::addr_t start_address;
+    lldb::addr_t end_address;
+    /// Register numbering scheme for location interpretation.
+    lldb::RegisterKind register_kind;
+
+    std::optional<std::string> decl_file;
+    std::optional<uint32_t> decl_line;
+    std::optional<std::string> type_name;
   };
 
   // Live state from the previous instruction, keyed by Variable::GetID().
   llvm::DenseMap<lldb::user_id_t, VarState> Live_;
 
+  static constexpr const char *kUndefLocation = "undef";
+
 public:
   /// Compute annotation strings for a single instruction and update `Live_`.
   /// Returns only the events that should be printed *at this instruction*.
   std::vector<std::string> annotate(Instruction &inst, Target &target,
                                     const lldb::ModuleSP &module_sp);
+
+  /// Compute structured annotation data for a single instruction and update
+  /// `Live_`. Returns structured data for all variables relevant at this
+  /// instruction.
+  std::vector<VariableAnnotation>
+  annotateStructured(Instruction &inst, Target &target,
+                     const lldb::ModuleSP &module_sp);
----------------
n2h9 wrote:

Good point :+1: .
That is because I followed the same signature as existing `annotate` function 
:blush: . 
Updated to use shared pointer by value (also updated in `annotate` function as 
well).

Thank you :bowing_woman: .

https://github.com/llvm/llvm-project/pull/165163
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to