Skip to content

Commit 807f7ad

Browse files
authored
[lldb] Use __TEXT segment in embedded summary test (#8245)
These test fixtures are true constants and can be placed in the `__TEXT` segment.
1 parent 903b63c commit 807f7ad

File tree

1 file changed

+16
-14
lines changed
  • lldb/test/API/functionalities/data-formatter/embedded-summary

1 file changed

+16
-14
lines changed

lldb/test/API/functionalities/data-formatter/embedded-summary/main.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
#include <stdio.h>
22

3+
#define LLDBSUMMARY __attribute__((section("__TEXT,__lldbsummaries"), used))
4+
35
struct Player {
46
char *name;
57
int number;
68
};
79

8-
__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char
9-
_Player_type_summary[] = "\x01" // version
10-
"\x25" // record size
11-
"\x07" // type name size
12-
"Player\0" // type name
13-
"\x1c" // summary string size
14-
"${var.name} (${var.number})"; // summary string
10+
LLDBSUMMARY unsigned char _Player_type_summary[] =
11+
"\x01" // version
12+
"\x25" // record size
13+
"\x07" // type name size
14+
"Player\0" // type name
15+
"\x1c" // summary string size
16+
"${var.name} (${var.number})"; // summary string
1517

1618
struct Layer {
1719
char *name;
1820
int number;
1921
};
2022

2123
// Near copy of the record for `Player`, using a regex type name (`^Layer`).
22-
__attribute__((used, section("__DATA_CONST,__lldbsummaries"))) unsigned char
23-
_Layer_type_summary[] = "\x01" // version
24-
"\x25" // record size
25-
"\x07" // type name size
26-
"^Layer\0" // type name
27-
"\x1c" // summary string size
28-
"${var.name} (${var.number})"; // summary string
24+
LLDBSUMMARY unsigned char _Layer_type_summary[] =
25+
"\x01" // version
26+
"\x25" // record size
27+
"\x07" // type name size
28+
"^Layer\0" // type name
29+
"\x1c" // summary string size
30+
"${var.name} (${var.number})"; // summary string
2931

3032
int main() {
3133
struct Player player;

0 commit comments

Comments
 (0)