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 @@ -1515,8 +1515,26 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) {
1515
1515
auto section_size = summaries_sp->GetSectionData (extractor);
1516
1516
lldb::offset_t offset = 0 ;
1517
1517
while (offset < section_size) {
1518
+ // Skip null bytes. Can happen with alignment padding.
1519
+ while (true ) {
1520
+ auto next_offset = offset;
1521
+ if (extractor.GetU8 (&next_offset) != 0 ) {
1522
+ break ;
1523
+ }
1524
+ // Move past the null byte, using the advanced offset.
1525
+ offset = next_offset;
1526
+ }
1527
+
1518
1528
uint64_t version = extractor.GetULEB128 (&offset);
1519
1529
uint64_t record_size = extractor.GetULEB128 (&offset);
1530
+ if (record_size == 0 ) {
1531
+ LLDB_LOGF (log,
1532
+ " Skipping empty (malformed) embedded type summary of version "
1533
+ " %llu in %s." ,
1534
+ version, module_name);
1535
+ continue ;
1536
+ }
1537
+
1520
1538
if (version == 1 ) {
1521
1539
uint64_t type_size = extractor.GetULEB128 (&offset);
1522
1540
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