Re: Print variable with gdb??
From: Mark P (not_at_my.real.email)
Date: 03/30/05
- Next message: Anthony Borla: "[OT - gdb-specific] Re: Print variable with gdb??"
- Previous message: JS: "Print variable with gdb??"
- In reply to: JS: "Print variable with gdb??"
- Next in thread: Anthony Borla: "[OT - gdb-specific] Re: Print variable with gdb??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 29 Mar 2005 23:43:06 GMT
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
You should know that this is off topic and you will likely find more
help in a compiler specific newsgroup.
Two pieces of advice regarding your problem. 1) Make sure p is in scope
when you attempt to print its value, and 2) make sure that you compile
with the -g option to enable debugging.
Mark
- Next message: Anthony Borla: "[OT - gdb-specific] Re: Print variable with gdb??"
- Previous message: JS: "Print variable with gdb??"
- In reply to: JS: "Print variable with gdb??"
- Next in thread: Anthony Borla: "[OT - gdb-specific] Re: Print variable with gdb??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|