File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
test/API/functionalities/data-formatter/embedded-summary Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -1476,8 +1476,26 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) {
1476
1476
auto section_size = summaries_sp->GetSectionData (extractor);
1477
1477
lldb::offset_t offset = 0 ;
1478
1478
while (offset < section_size) {
1479
+ // Skip null bytes. Can happen with alignment padding.
1480
+ while (true ) {
1481
+ auto next_offset = offset;
1482
+ if (extractor.GetU8 (&next_offset) != 0 ) {
1483
+ break ;
1484
+ }
1485
+ // Move past the null byte, using the advanced offset.
1486
+ offset = next_offset;
1487
+ }
1488
+
1479
1489
uint64_t version = extractor.GetULEB128 (&offset);
1480
1490
uint64_t record_size = extractor.GetULEB128 (&offset);
1491
+ if (record_size == 0 ) {
1492
+ LLDB_LOGF (log,
1493
+ " Skipping empty (malformed) embedded type summary of version "
1494
+ " %llu in %s." ,
1495
+ version, module_name);
1496
+ continue ;
1497
+ }
1498
+
1481
1499
if (version == 1 ) {
1482
1500
uint64_t type_size = extractor.GetULEB128 (&offset);
1483
1501
llvm::StringRef type_name = extractor.GetCStr (&offset, type_size);
Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ struct Player {
5
5
int number ;
6
6
};
7
7
8
- __attribute__((aligned (1 ), used ,
9
- section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
8
+ __attribute__((used , section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
10
9
_Player_type_summary [] = "\x01" // version
11
10
"\x25" // record size
12
11
"\x07" // type name size
@@ -20,8 +19,7 @@ struct Layer {
20
19
};
21
20
22
21
// Near copy of the record for `Player`, using a regex type name (`^Layer`).
23
- __attribute__((aligned (1 ), used ,
24
- section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
22
+ __attribute__((used , section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
25
23
_Layer_type_summary [] = "\x01" // version
26
24
"\x25" // record size
27
25
"\x07" // type name size
You can’t perform that action at this time.
0 commit comments