File tree Expand file tree Collapse file tree 3 files changed +37
-8
lines changed
test/API/functionalities/data-formatter/embedded-summary Expand file tree Collapse file tree 3 files changed +37
-8
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,13 @@ static void ForEachFormatterInModule(
50
50
uint8_t addr_size = section.getAddressSize ();
51
51
llvm::DataExtractor::Cursor cursor (0 );
52
52
while (cursor && cursor.tell () < section_size) {
53
+ while (cursor && cursor.tell () < section_size) {
54
+ // Skip over 0 padding.
55
+ if (section.getU8 (cursor) == 0 )
56
+ continue ;
57
+ cursor.seek (cursor.tell () - 1 );
58
+ break ;
59
+ }
53
60
uint64_t version = section.getULEB128 (cursor);
54
61
uint64_t record_size = section.getULEB128 (cursor);
55
62
if (version == 1 ) {
Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ def test(self):
10
10
self .build ()
11
11
lldbutil .run_to_source_breakpoint (self , "break here" , lldb .SBFileSpec ("main.c" ))
12
12
self .expect ("v player" , substrs = ['"Dirk" (41)' ])
13
+ self .expect ("v layer" , substrs = ['"crust" (3)' ])
Original file line number Diff line number Diff line change 1
- #include <stdio.h>
1
+ void puts (const char * );
2
+
3
+ #define LLDBSUMMARY __attribute__((section("__TEXT,__lldbsummaries"), used))
2
4
3
5
struct Player {
4
6
char * name ;
5
7
int number ;
6
8
};
7
9
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
17
+
18
+ struct Layer {
19
+ char * name ;
20
+ int number ;
21
+ };
22
+
23
+ LLDBSUMMARY unsigned char _padding [] = "\x00\x00" ;
24
+
25
+ // Near copy of the record for `Player`, using a regex type name (`^Layer`).
26
+ LLDBSUMMARY unsigned char _Layer_type_summary [] =
27
+ "\x01" // version
28
+ "\x25" // record size
29
+ "\x07" // type name size
30
+ "^Layer\0" // type name
31
+ "\x1c" // summary string size
32
+ "${var.name} (${var.number})" ; // summary string
15
33
16
34
int main () {
17
35
struct Player player ;
18
36
player .name = "Dirk" ;
19
37
player .number = 41 ;
38
+ struct Layer layer ;
39
+ layer .name = "crust" ;
40
+ layer .number = 3 ;
20
41
puts ("break here" );
21
42
return 0 ;
22
43
}
You can’t perform that action at this time.
0 commit comments