X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=.gdbinit;h=6d168c4a0bf98631f5dc71e37d6e8b9889d4d1fb;hb=e2bfa49144d1f2f6c39eabf4988c50e4aed1aae0;hp=1fbf9687eb9466deabaa1682bb6c64ac2c45c868;hpb=02c2070831c36926e60e1aaa6323cf2fa39757dd;p=nethome.git diff --git a/.gdbinit b/.gdbinit index 1fbf968..6d168c4 100644 --- a/.gdbinit +++ b/.gdbinit @@ -1,9 +1,22 @@ +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 # 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 @@ -34,14 +47,31 @@ define plist if $argc==1 print *$plist_iter else - print $plist_iter->$arg1 + if $argc==2 + print $plist_iter->$arg1 + else + print$arg2 $plist_iter->$arg1 + end end set var $plist_iter=$plist_iter->next end end document plist List dumper iterating by `->next': -plist [] +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 @@ -51,3 +81,20 @@ 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