File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
test/API/functionalities/data-formatter/embedded-summary Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -1491,7 +1491,7 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) {
1491
1491
return ;
1492
1492
1493
1493
Log *log = GetLog (LLDBLog::DataFormatters);
1494
- const char *module_name = module_sp->GetObjectName ().GetCString ();
1494
+ const char *module_name = module_sp->GetFileSpec (). GetFilename ().GetCString ();
1495
1495
1496
1496
TypeCategoryImplSP category;
1497
1497
DataVisualization::Categories::GetCategory (ConstString (" default" ), category);
@@ -1527,7 +1527,7 @@ static void LoadTypeSummariesForModule(ModuleSP module_sp) {
1527
1527
auto summary_sp =
1528
1528
std::make_shared<StringSummaryFormat>(flags, summary_string.data ());
1529
1529
FormatterMatchType match_type = eFormatterMatchExact;
1530
- if (summary_string .front () == ' ^' && summary_string. back () == ' $ ' )
1530
+ if (type_name .front () == ' ^' )
1531
1531
match_type = eFormatterMatchRegex;
1532
1532
category->AddTypeSummary (type_name, match_type, summary_sp);
1533
1533
LLDB_LOGF (log, " Loaded embedded type summary for '%s' from %s." ,
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 @@ -5,18 +5,37 @@ struct Player {
5
5
int number ;
6
6
};
7
7
8
- __attribute__((used , section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
8
+ __attribute__((aligned (1 ), used ,
9
+ section ("__DATA_CONST,__lldbsummaries" ))) unsigned char
9
10
_Player_type_summary [] = "\x01" // version
10
11
"\x25" // record size
11
12
"\x07" // type name size
12
13
"Player\0" // type name
13
14
"\x1c" // summary string size
14
15
"${var.name} (${var.number})" ; // summary string
15
16
17
+ struct Layer {
18
+ char * name ;
19
+ int number ;
20
+ };
21
+
22
+ // 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
25
+ _Layer_type_summary [] = "\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
31
+
16
32
int main () {
17
33
struct Player player ;
18
34
player .name = "Dirk" ;
19
35
player .number = 41 ;
36
+ struct Layer layer ;
37
+ layer .name = "crust" ;
38
+ layer .number = 3 ;
20
39
puts ("break here" );
21
40
return 0 ;
22
41
}
You can’t perform that action at this time.
0 commit comments