Print variable with gdb??

Russell Shaw rjshaw@netspace.net.au
Wed Mar 30 09:28:00 GMT 2005


JS wrote:
> I have:
> 
> int p = 5;
> 
> when I debug my code I would like to get a print of p's value therefore I
> start gdb and type:
> 
> print p
> 
> but then I get an error that the variable does not exists!
> 
> Hope someone can help!
> 
> JS

Type "start" so it runs to main(). print p should work if
p is in scope.



More information about the Gdb mailing list