X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=.gdbinit;h=6d168c4a0bf98631f5dc71e37d6e8b9889d4d1fb;hb=e2bfa49144d1f2f6c39eabf4988c50e4aed1aae0;hp=4945497d87ce65539a4d8c963c7fa18b0df0212f;hpb=b5a66fdb148e0023de0886b464ad3bee0a1a5c07;p=nethome.git diff --git a/.gdbinit b/.gdbinit index 4945497..6d168c4 100644 --- a/.gdbinit +++ b/.gdbinit @@ -1,35 +1,100 @@ -set history filename /home/short/.gdb_history +add-auto-load-safe-path ~/src/stock +add-auto-load-safe-path ~/src/interview/.gdbinit +add-auto-load-safe-path ~/src/interview/asan/*-gdb.gdb +add-auto-load-safe-path ~/src/toptal.com-codility.com/.gdbinit +add-auto-load-safe-path ~/src/toptal.com-codility.com/asan/*-gdb.gdb +define bt + disable frame-filter all + backtrace +end + +set break pending on +set style enabled off +# 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 - tbreak $arg0 - continue - end -define rtl - tbreak main - run - break $arg0 - continue -# clear $arg0 - end -define pglist3 +# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=106814 +set complaints 0 +set record full 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 + 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 + +define mycommand + set $i = 0 + set $foo1=$arg1 + while $i < $argc + eval "print $foo%d", $i + set $i = $i + 1 + end +end