Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gcc - gdb compatibility issue
@ 2009-04-27  6:03 sumanth
  2009-04-27  6:30 ` Paul Pluzhnikov
  0 siblings, 1 reply; 9+ messages in thread
From: sumanth @ 2009-04-27  6:03 UTC (permalink / raw)
  To: gdb

Hi,
I am using gcc-4.3.3 and gdb 5.3 version.
I have problems in  debugging my  binaries (a.out)  concerned to local 
variable's address location.
Is there any gcc-gdb compatibility issue here. If so how can I generate 
the correct debugging information and use it.

Thanks in advance,
Sumanth


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-27  6:03 gcc - gdb compatibility issue sumanth
@ 2009-04-27  6:30 ` Paul Pluzhnikov
  2009-04-27  6:32   ` Joel Brobecker
  2009-04-27  6:36   ` sumanth
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Pluzhnikov @ 2009-04-27  6:30 UTC (permalink / raw)
  To: sumanth; +Cc: gdb

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,
-- 
Paul Pluzhnikov


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-27  6:30 ` Paul Pluzhnikov
@ 2009-04-27  6:32   ` Joel Brobecker
  2009-04-27  6:42     ` sumanth
  2009-04-27  6:36   ` sumanth
  1 sibling, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2009-04-27  6:32 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: sumanth, gdb

> > I am using gcc-4.3.3 and gdb 5.3 version.
> 
> That's a rather new GCC and rather old GDB.

One of the major problems of debugging GCC 4.3 code with such an old
GDB is that GDB 5.3 doesn't handle location lists (assuming that
the debugging info is DWARF). That may be your problem.

Paul provided a lot of very good advice.  If that doesn't work, you
might want to try the current CVS HEAD or our latest release, which
is 6.8. I'm seeing a lot of hard work being done by several contributors
towards 7.0 as well which hopefully we'll release before June this year.

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-27  6:30 ` Paul Pluzhnikov
  2009-04-27  6:32   ` Joel Brobecker
@ 2009-04-27  6:36   ` sumanth
  1 sibling, 0 replies; 9+ messages in thread
From: sumanth @ 2009-04-27  6:36 UTC (permalink / raw)
  To: Paul Pluzhnikov; +Cc: gdb

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,
>   



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-27  6:32   ` Joel Brobecker
@ 2009-04-27  6:42     ` sumanth
  2009-04-27  6:55       ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: sumanth @ 2009-04-27  6:42 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Paul Pluzhnikov, gdb

Joel ... Is there a way that i can avoid location lists generated by my 
compiler
and i am using DWARF 2

Thanks to joel and paul
sumanth
Joel Brobecker wrote:
>>> I am using gcc-4.3.3 and gdb 5.3 version.
>>>       
>> That's a rather new GCC and rather old GDB.
>>     
>
> One of the major problems of debugging GCC 4.3 code with such an old
> GDB is that GDB 5.3 doesn't handle location lists (assuming that
> the debugging info is DWARF). That may be your problem.
>
> Paul provided a lot of very good advice.  If that doesn't work, you
> might want to try the current CVS HEAD or our latest release, which
> is 6.8. I'm seeing a lot of hard work being done by several contributors
> towards 7.0 as well which hopefully we'll release before June this year.
>
>   



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Brobecker @ 2009-04-27  6:55 UTC (permalink / raw)
  To: sumanth; +Cc: Paul Pluzhnikov, gdb

> Joel ... Is there a way that i can avoid location lists generated by
> my  compiler and i am using DWARF 2

Not as far as I know. When we discovered that GDB 5.3 wasn't handling
them very well (if at all, actually, I can't remember the symptoms
anymore), we found that the fastest change until we could switch
to a more recent debugger was to hack the compiler to avoid their
generation. Olivier Hainque made the change, it was relatively
localized.

I suspect upgrading the debugger is going to be a lot easier than
hacking the compiler.  That being said, location lists are not
necessarily the actual cause of your specific issue. It would be
hard to tell without debugging the debugger itself.

-- 
Joel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-27  6:55       ` Joel Brobecker
@ 2009-04-27 13:19         ` sumanth
  2009-04-28  4:41         ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: sumanth @ 2009-04-27 13:19 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Paul Pluzhnikov, gdb

Joel , if you don't mind
can you brief me on this
"

I suspect upgrading the debugger is going to be a lot easier than
hacking the compiler.  That being said, location lists are not
necessarily the actual cause of your specific issue. It would be
hard to tell without debugging the debugger itself.

"

Thanks in advance ,
Sumanth G
Joel Brobecker wrote:
>> Joel ... Is there a way that i can avoid location lists generated by
>> my  compiler and i am using DWARF 2
>>     
>
> Not as far as I know. When we discovered that GDB 5.3 wasn't handling
> them very well (if at all, actually, I can't remember the symptoms
> anymore), we found that the fastest change until we could switch
> to a more recent debugger was to hack the compiler to avoid their
> generation. Olivier Hainque made the change, it was relatively
> localized.
>
> I suspect upgrading the debugger is going to be a lot easier than
> hacking the compiler.  That being said, location lists are not
> necessarily the actual cause of your specific issue. It would be
> hard to tell without debugging the debugger itself.
>
>   



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2009-04-28  4:41 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: sumanth.gundapneni, ppluzhnikov, gdb

> Date: Sun, 26 Apr 2009 23:42:25 -0700
> From: Joel Brobecker <brobecker@adacore.com>
> Cc: Paul Pluzhnikov <ppluzhnikov@google.com>, gdb@sourceware.org
> 
> I suspect upgrading the debugger is going to be a lot easier than
> hacking the compiler.

Alternatively, the OP could try compiling with -gstabs+ instead of
just -g.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gcc - gdb compatibility issue
  2009-04-28  4:41         ` Eli Zaretskii
@ 2009-04-28  6:22           ` sumanth
  0 siblings, 0 replies; 9+ messages in thread
From: sumanth @ 2009-04-28  6:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joel Brobecker, ppluzhnikov, gdb

Eli Zaretskii wrote:
>> Date: Sun, 26 Apr 2009 23:42:25 -0700
>> From: Joel Brobecker <brobecker@adacore.com>
>> Cc: Paul Pluzhnikov <ppluzhnikov@google.com>, gdb@sourceware.org
>>
>> I suspect upgrading the debugger is going to be a lot easier than
>> hacking the compiler.
>>     
>
> Alternatively, the OP could try compiling with -gstabs+ instead of
> just -g.
>
>
>   
my target system won't support stabs debugging format


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-04-28  4:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27  6:03 gcc - gdb compatibility issue 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox