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) {
14761476 auto section_size = summaries_sp->GetSectionData (extractor);
14771477 lldb::offset_t offset = 0 ;
14781478 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+
14791489 uint64_t version = extractor.GetULEB128 (&offset);
14801490 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+
14811499 if (version == 1 ) {
14821500 uint64_t type_size = extractor.GetULEB128 (&offset);
14831501 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 {
55 int number ;
66};
77
8- __attribute__((aligned (1 ), used ,
9- section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
8+ __attribute__((used , section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
109 _Player_type_summary [] = "\x01" // version
1110 "\x25" // record size
1211 "\x07" // type name size
@@ -20,8 +19,7 @@ struct Layer {
2019};
2120
2221// 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
2523 _Layer_type_summary [] = "\x01" // version
2624 "\x25" // record size
2725 "\x07" // type name size
You can’t perform that action at this time.
0 commit comments