Skip to content

[lldb] Use __TEXT segment in embedded summary test #8245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
#include <stdio.h>

#define LLDBSUMMARY __attribute__((section("__TEXT,__lldbsummaries"), used))

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
LLDBSUMMARY 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

struct Layer {
char *name;
int number;
};

// Near copy of the record for `Player`, using a regex type name (`^Layer`).
__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char
_Layer_type_summary[] = "\x01" // version
"\x25" // record size
"\x07" // type name size
"^Layer\0" // type name
"\x1c" // summary string size
"${var.name} (${var.number})"; // summary string
LLDBSUMMARY unsigned char _Layer_type_summary[] =
"\x01" // version
"\x25" // record size
"\x07" // type name size
"^Layer\0" // type name
"\x1c" // summary string size
"${var.name} (${var.number})"; // summary string

int main() {
struct Player player;
Expand Down