This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: MACROS in gdb ???
- To: Aditya Chugh <Aditya at in dot huawei dot com>
- Subject: Re: MACROS in gdb ???
- From: Daniel Berlin <dberlin at redhat dot com>
- Date: 19 Mar 2001 23:07:47 -0500
- Cc: jtc at redback dot com, bug-gdb at prep dot ai dot mit dot edu, gdb at sourceware dot cygnus dot com
- References: <70EB682332F4D41187D6000629AE2C651AE3E4@mail.in.huawei.com>
Aditya Chugh <Aditya@in.huawei.com> writes:
> Hello Jtc,
> Many thanks for your help.
> The target I'm using is a Linux machine
> running kernel version 2.2.16-22(Red Hat Linux release 7.0)
> and the version of gdb is 5.0.
>
> Also the gdb output looked like this....?
> (gdb) p u2IncarnId
> $2 = 0
> (gdb) n
> (gdb) p u2IncarnId
> $3 = 1
> (gdb) p &u2IncarnId
> Address requested for identifier "u2IncarnId" which is in a register.
> (gdb)
>
> I found that one of the Makefiles I was using has
> CCFLAGS = -O2 -Wall.After removing the -O2 the problem seems to have been
> resolved.
>
> But does this mean that if we complile using GNU CC with both `-g' and `-O'
> options
> GDB will give us wrong results ?? Moreover the same code when run in Visual
> Studio 6.0
> prints correct values for u2IncarnId.Does this mean that the debugger in
> Visual Studio 6.0
> is better than GDB for optimized code ?
Right now?
Quite possibly.
Optimized debugging support in GDB is only really possible through
fully supporting things we don't fully support yet.
--Dan