[Lldb-commits] [PATCH] D145180: [lldb] Introduce new SymbolFileJSON and ObjectFileJSON

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 6 14:39:22 PST 2023


clayborg added a comment.

If these files can be used as the only source of information (without a stripped executable), we really should include a serialized SectionList in the JSON that can be loaded into ObjectFileJSON. This would be very useful for easily creating unit tests.



================
Comment at: lldb/include/lldb/Symbol/Symbol.h:23
+struct JSONSymbol {
+  uint64_t value;
+  std::optional<uint64_t> size;
----------------
Do we something that says "value is an address"? Or are we inferring that from the lldb::SymbolType?


================
Comment at: lldb/test/API/macosx/symbols/TestSymbolFileJSON.py:39
+            "size": main_symbol.GetSize(),
+            "value": main_symbol.addr.GetFileAddress(),
+        })
----------------
we probably should test that the "id" and "section_id" fields work correctly. We should also test that we are able to make symbols with only an address and name, then add tests for symbols that each add a new optional value that can be specified to ensure we can correctly make symbols. 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145180/new/

https://reviews.llvm.org/D145180



More information about the lldb-commits mailing list