Debugging : is it possible to print all local variable (with values) of C code without going into each stack frame? -


i trying explore gdb, objdump, valgrind , nm tools debugging purpose in linux.

i able print local variables using info locals in gdb need go current stack frame print local variables.

is there way print local , global variables (with values) used in c code (maybe coredump if program crashed) without going particular stack frame?

as pointed out, in gdb can show local variables current frame info locals. if restriction don't want manually go each frame, can use simple gdb script you. example:

define locals-up   set $n    = ($arg0)   set $upto = $n   while $upto > 0     info locals     up-silently 1                                                                     set $upto = $upto - 1   end   down-silently $n end document locals-up   locals-up <n>: lists local variables of n frames end 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -