[Lldb-commits] [lldb] [lldb] Load embedded type summary section (#7859) (#8040) (PR #113743)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 28 07:02:05 PDT 2024


================
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+struct Player {
+  char *name;
+  int number;
+};
+
+__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char
+    _Player_type_summary[] = "\x01"     // version
+                             "\x25"     // record size
+                             "\x07"     // type name size
+                             "Player\0" // type name
+                             "\x1c"     // summary string size
+                             "${var.name} (${var.number})"; // summary string
+
+int main() {
+  struct Player player;
+  player.name = "Dirk";
+  player.number = 41;
+  puts("break here");
----------------
DavidSpickett wrote:

Does this actually show up in the logs? If so `return 0 // break here` would be a bit more tidy.

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


More information about the lldb-commits mailing list