File tree Expand file tree Collapse file tree 4 files changed +18
-0
lines changed
testsuite/tests/matchers/typename Expand file tree Collapse file tree 4 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,16 @@ procedure Foo is
2
2
type My_Int_1 is new Integer;
3
3
type My_Int_2 is new Integer;
4
4
5
+ type My_Nat is new Natural;
6
+
5
7
I1 : My_Int_1 := 10 ;
6
8
I2 : My_Int_2 := 20 ;
9
+ N : My_Nat := 30 ;
10
+
11
+ I : Integer := 0 ;
7
12
begin
8
13
I1 := I1 + My_Int_1 (I2); -- BREAK
9
14
I2 := I2 + My_Int_2 (I1);
15
+ N := N + 1 ;
16
+ I := I + 1 ;
10
17
end Foo ;
Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ def to_string(self):
12
12
return 'My_Int ({})' .format (int (self .value ))
13
13
14
14
15
+ class MyNatPrinter (PrettyPrinter ):
16
+ name = 'My Nat'
17
+ type_pattern = Match .TypeName (name = 'foo.my_nat' )
18
+
19
+ def to_string (self ):
20
+ return 'My_Nat ({})' .format (int (self .value ))
21
+
22
+
15
23
printers = GDBPrettyPrinters ('test' )
16
24
printers .append (MyIntPrinter )
25
+ printers .append (MyNatPrinter )
17
26
gdb .selected_frame ().function ().symtab .objfile .pretty_printers .append (printers )
Original file line number Diff line number Diff line change 9
9
gdb .test ('source pp.py' , '' )
10
10
gdb .print_expr ('i1' , 'My_Int (10)' )
11
11
gdb .print_expr ('i2' , 'My_Int (20)' )
12
+ gdb .print_expr ('n' , 'My_Nat (30)' )
13
+ gdb .print_expr ('i' , '0' )
File renamed without changes.
You can’t perform that action at this time.
0 commit comments