build: Use $HOME/ path for errs12.
[nethome.git] / .gdbinit
1 # See .bashrc: export GDBHISTFILE="$HOME/.gdb_history"
2 # Should also work <jefyi6bzm6.fsf@sykes.suse.de> (untested):
3 # set history filename ~/.gdb_history
4 set history save on
5 # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=106814
6 set complaints 0
7 set record insn-number-max 10000000
8 define javadump
9         call _Jv_DeepDebug($arg0)
10 end
11 document javadump
12 call _Jv_DeepDebug($arg0)
13 end
14 define pglist
15         if (*("$arg1")=='@')
16                 set var $arg1=struct $arg1
17         end
18         set var $pglist_list=$arg0
19         while ($pglist_list)
20                 if $argc==2
21                         print *(($arg1 *)$pglist_list->data)
22                 else
23                         print *(($arg1 *)$pglist_list->data)$arg2
24                 end
25                 set var $pglist_list=$pglist_list->next
26         end
27 end
28 document pglist
29 GList or GSList dumper iterating by `->next':
30 pglist <head pointer> {<data type>|@<struct data type>} [<data field to display>]
31 end
32 define plist
33         set var $plist_iter=$arg0
34         while ($plist_iter)
35                 if $argc==1
36                         print *$plist_iter
37                 else
38                         if $argc==2
39                                 print $plist_iter->$arg1
40                         else
41                                 print$arg2 $plist_iter->$arg1
42                         end
43                 end
44                 set var $plist_iter=$plist_iter->next
45         end
46 end
47 document plist
48 List dumper iterating by `->next':
49 plist <head pointer> [<data field to display>] [/<format>]
50 end
51 define countlist
52         set var $countlist_iter=$arg0
53         set var $countlist_count=0
54         while ($countlist_iter)
55                 set var $countlist_iter=$countlist_iter->next
56                 set var $countlist_count=$countlist_count+1
57         end
58         p $countlist_count
59 end
60 document countlist
61 List elements counter iterating by `->next':
62 countlist <head pointer>
63 end
64 define debug
65         set debug infrun 1
66         set debug lin-lwp 1
67 end
68 document debug
69 set debug infrun 1
70 set debug lin-lwp 1
71 end
72 define sip
73         stepi
74         x/i $pc
75 end
76 define nip
77         nexti
78         x/i $pc
79 end