Fix `$rpath/usr/local/share/gdb'.
[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 define javadump
8         call _Jv_DeepDebug($arg0)
9 end
10 document javadump
11 call _Jv_DeepDebug($arg0)
12 end
13 define pglist
14         if (*("$arg1")=='@')
15                 set var $arg1=struct $arg1
16         end
17         set var $pglist_list=$arg0
18         while ($pglist_list)
19                 if $argc==2
20                         print *(($arg1 *)$pglist_list->data)
21                 else
22                         print *(($arg1 *)$pglist_list->data)$arg2
23                 end
24                 set var $pglist_list=$pglist_list->next
25         end
26 end
27 document pglist
28 GList or GSList dumper iterating by `->next':
29 pglist <head pointer> {<data type>|@<struct data type>} [<data field to display>]
30 end
31 define plist
32         set var $plist_iter=$arg0
33         while ($plist_iter)
34                 if $argc==1
35                         print *$plist_iter
36                 else
37                         if $argc==2
38                                 print $plist_iter->$arg1
39                         else
40                                 print$arg2 $plist_iter->$arg1
41                         end
42                 end
43                 set var $plist_iter=$plist_iter->next
44         end
45 end
46 document plist
47 List dumper iterating by `->next':
48 plist <head pointer> [<data field to display>] [/<format>]
49 end
50 define countlist
51         set var $countlist_iter=$arg0
52         set var $countlist_count=0
53         while ($countlist_iter)
54                 set var $countlist_iter=$countlist_iter->next
55                 set var $countlist_count=$countlist_count+1
56         end
57         p $countlist_count
58 end
59 document countlist
60 List elements counter iterating by `->next':
61 countlist <head pointer>
62 end
63 define debug
64         set debug infrun 1
65         set debug lin-lwp 1
66 end
67 document debug
68 set debug infrun 1
69 set debug lin-lwp 1
70 end
71 define sip
72         stepi
73         x/i $pc
74 end
75 define nip
76         nexti
77         x/i $pc
78 end