From: sumanth <sumanth.gundapneni@redpinesignals.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: gdb@sourceware.org
Subject: Re: gcc - gdb compatibility issue
Date: Mon, 27 Apr 2009 06:36:00 -0000 [thread overview]
Message-ID: <49F54F67.8@redpinesignals.com> (raw)
In-Reply-To: <8ac60eac0904262303q4f5b430ak5a14ba34f3dedd7f@mail.gmail.com>
hi,
I tried compiling with '-g -O0' option, result is same.
Since I am not using a well known architecture , i need to port gdb to
my architecture.
gcc --version gives gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30).
The problem here is ,it is generating local variables address but not
in the current frame. But when I compile
with '-g -O0 -fvar-tracking ' I got partial correct information .
Let me explain with an example :
int main()
{
volatile int a, b , c;
a =10;
b =20;
c =add(a,b);
return 0;
}
int add(int x, int y)
{
return x+y;
}
With '-g -O0' all the local variable's address i.e a,b,c generated is wrong.
with '-g -O0 -fvar-tracking ' a,b 's address is generated correct. c
variable's address is wrong.
I am confident that there is no error from compiler side . So, I am
asking for any compatibility issue regarding gcc-gdb versions.
sumanth
Paul Pluzhnikov wrote:
> On Sun, Apr 26, 2009 at 10:17 PM, sumanth
> <sumanth.gundapneni@redpinesignals.com> wrote:
>
>
>> I am using gcc-4.3.3 and gdb 5.3 version.
>>
>
> That's a rather new GCC and rather old GDB.
>
>
>> I have problems in debugging my binaries (a.out) concerned to local
>> variable's address location.
>>
>
> What kind of problems?
> Did you compile with -O, -O2, or -O3?
> Debugging optimized code is always problematic: the compiler may not
> have assigned address for a local variable at all.
>
>
>> Is there any gcc-gdb compatibility issue here. If so how can I generate the
>> correct debugging information and use it.
>>
>
> Start by compiling with '-g -O0'.
> If that doesn't work, try current GDB built from CVS Head.
> If that still doesn't work, show us your compile line, and output from
> 'gcc --version'.
>
> Cheers,
>
prev parent reply other threads:[~2009-04-27 6:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-27 6:03 sumanth
2009-04-27 6:30 ` Paul Pluzhnikov
2009-04-27 6:32 ` Joel Brobecker
2009-04-27 6:42 ` sumanth
2009-04-27 6:55 ` Joel Brobecker
2009-04-27 13:19 ` sumanth
2009-04-28 4:41 ` Eli Zaretskii
2009-04-28 6:22 ` sumanth
2009-04-27 6:36 ` sumanth [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49F54F67.8@redpinesignals.com \
--to=sumanth.gundapneni@redpinesignals.com \
--cc=gdb@sourceware.org \
--cc=ppluzhnikov@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox