X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=.gdbinit;h=5a1e9b73b13d3656555ed59f995b80cbdf18c092;hp=f60ba04d6f9e7ff8fd5ecdc2a9abb7c665010b8f;hb=392d4743fe31e605931e9a3bf614202f2d9cc1ad;hpb=676d32680ce953572d713c9d4651b24fdffdcd85 diff --git a/.gdbinit b/.gdbinit index f60ba04..5a1e9b7 100644 --- a/.gdbinit +++ b/.gdbinit @@ -1,36 +1,79 @@ -set history filename /home/short/.gdb_history +# See .bashrc: export GDBHISTFILE="$HOME/.gdb_history" +# Should also work (untested): +# set history filename ~/.gdb_history set history save on -define rt - break $arg0 - run -# clear $arg0 - end -define ct - break $arg0 - continue - clear $arg0 - end -define rtl - break main - run - clear main - break $arg0 - continue -# clear $arg0 - end -define pglist3 +# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=106814 +set complaints 0 +set record insn-number-max 10000000 +define javadump + call _Jv_DeepDebug($arg0) +end +document javadump +call _Jv_DeepDebug($arg0) +end +define pglist if (*("$arg1")=='@') set var $arg1=struct $arg1 + end set var $pglist_list=$arg0 while ($pglist_list) - if (!strcmp("$arg2",".")) + if $argc==2 print *(($arg1 *)$pglist_list->data) else print *(($arg1 *)$pglist_list->data)$arg2 - end + end set var $pglist_list=$pglist_list->next + end +end +document pglist +GList or GSList dumper iterating by `->next': +pglist {|@} [] +end +define plist + set var $plist_iter=$arg0 + while ($plist_iter) + if $argc==1 + print *$plist_iter + else + if $argc==2 + print $plist_iter->$arg1 + else + print$arg2 $plist_iter->$arg1 + end end + set var $plist_iter=$plist_iter->next end -define pglist - pglist3 $arg0 $arg1 . +end +document plist +List dumper iterating by `->next': +plist [] [/] +end +define countlist + set var $countlist_iter=$arg0 + set var $countlist_count=0 + while ($countlist_iter) + set var $countlist_iter=$countlist_iter->next + set var $countlist_count=$countlist_count+1 end + p $countlist_count +end +document countlist +List elements counter iterating by `->next': +countlist +end +define debug + set debug infrun 1 + set debug lin-lwp 1 +end +document debug +set debug infrun 1 +set debug lin-lwp 1 +end +define sip + stepi + x/i $pc +end +define nip + nexti + x/i $pc +end