Thursday, October 29, 2009

print array,structure,union in gdb

gdb is a very strong tool. It can even print structure,union and array the way you want.
- To print array :
int *arr
gdb> print *arr@5 // will print 5 elements of the array

Following variables can be set to print them in one per line :
set print array on
set print pretty on // for printing structure in nice form
set print union on
...

And there are lot more. Just need to do
info gcc on linux box (if info is installed)
or
gcc> help is very helpful.

Wednesday, October 28, 2009

This blog is suppose to contain the day-to-day tips and tricks, for which I keep using google..
These tips/tricks/steps will not be restricted to Computer Science and related areas, but may go even limits of "how to start PRIYA/BAJAJ" Scooter ;).

Visitor's benefit is the sole purpose here !

Have Fun!