================
@@ -566,6 +566,21 @@ class Disassembler : public 
std::enable_shared_from_this<Disassembler>,
   const Disassembler &operator=(const Disassembler &) = delete;
 };
 
+/// Structured data for a single variable annotation
+struct VariableAnnotation {
+  std::string variable_name;
+  std::string location_description; // e.g., "r15", "undef", "const_0"
+  lldb::addr_t start_address;       // Where this annotation starts being valid
+  lldb::addr_t end_address;         // Where this annotation ends being valid
+  bool is_live; // Whether variable is live at this instruction
+  lldb::RegisterKind
+      register_kind; // Register numbering scheme for location interpretation
+  std::optional<std::string>
+      decl_file;                     // Source file where variable was declared
+  std::optional<uint32_t> decl_line; // Line number where variable was declared
----------------
n2h9 wrote:

The idea is to provide an information in this fields on  where the variable is 
declared, like we  we have in a DWARF output.
The data comes from 
[Declaration](https://github.com/llvm/llvm-project/blob/main/lldb/include/lldb/Core/Declaration.h#L124)
 object which returns line number as uint.

We only have (and probably only need for the purpose of variable annotation) 
information on file name, line number and column number from Declaration 
object. While LineEntry suppose to contain more information in it. 

I think it’s better to keep this as a uint. What do you think?


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