This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Still cannot print variable


On Fri, Apr 15, 2005 at 11:09:09AM +0200, JS wrote:
> I am still have problems printing a variable. I have this code in a file
> called test.:
> 
> int main()
> {
> 
>         int d = 119;
> 
>         return(0);
> 
> }
> 
> I then compile it like this:
> 
>         gcc -g -Wall -o test test.c
> 
> (I have also tried with option -O0 but that changes nothing).
> 
> I run "gdb test" followed by "print d" and then I get this error:

You know, I just realized it's kind of odd that GDB doesn't look on the
users PATH to figure out which program to debug. For instance, it must
first look in the . directory, which is why this works in the first
place. I'd expect GDB to start debugging /usr/bin/test, as if he'd run
'test' on the command line.

Bob Rossi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]