comp.lang.ada
 help / color / mirror / Atom feed
* gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
@ 2002-12-28 22:47 Harry Rockefeller
  2002-12-31 14:54 ` Harry Rockefeller
  0 siblings, 1 reply; 7+ messages in thread
From: Harry Rockefeller @ 2002-12-28 22:47 UTC (permalink / raw)


I have a gentoo Linux system and applied the
bugzilla patch to get Ada built into gcc 3.2.1
but found out that my gdb doesn't understand
the source language Ada.

What can I do to fix this?  I would rather not
go back to the GNAT stand-alone distribution 
based on gcc 2.8.1.

If this is answered in a Howto or FAQ please
excuse this post and simply direct me to the
proper place.

Thank you.



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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-28 22:47 gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does Harry Rockefeller
@ 2002-12-31 14:54 ` Harry Rockefeller
  2002-12-31 18:20   ` Waldek Hebisch
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Harry Rockefeller @ 2002-12-31 14:54 UTC (permalink / raw)


harryr@ssd.fsi.com (Harry Rockefeller) wrote in message news:<d9a42677.0212281447.7d77da47@posting.google.com>...

I was wondering why there was no response.  I think I
misdiagnosed the problem and so will provide a bit more
detail too.

> I have a gentoo Linux system and applied the
> bugzilla patch to get Ada built into gcc 3.2.1

The problem appears to be here.  When I run gdb 5.2.1 on
the executable created I get an internal error -
"unimplemented function unk_lang_create_fundamental_type called"
when trying to set a breakpoint at a line in my Ada source.
show lang and info extensions also seemed to indicate that gdb
was not "Ada aware".

> but found out that my gdb doesn't understand
> the source language Ada.

This is not true.  When I compile my Ada program using the
NYU gcc 2.8.1 the gdb 5.2.1 works and allows me to set
breakpoints, etc.  show lang still gives "auto; currently c"
and info extensions doesn't show any gnat aware extensions,
but it works none the less.

An interesting side issue is that the gdb provided with the NYU
dist fails to execute; failing with libncurses.so.4 can't be found.

I'll still accept any help from readers of this newsgroup, but
I also will post in the Gentoo programming forum as well since
it appears the problem may be with their Ada patch for gcc 3.2.1.



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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-31 14:54 ` Harry Rockefeller
@ 2002-12-31 18:20   ` Waldek Hebisch
  2003-01-02 16:03     ` Harry Rockefeller
  2002-12-31 22:56   ` sk
  2003-01-01 20:46   ` Ed Cogburn
  2 siblings, 1 reply; 7+ messages in thread
From: Waldek Hebisch @ 2002-12-31 18:20 UTC (permalink / raw)


Harry Rockefeller (harryr@ssd.fsi.com) wrote:
: harryr@ssd.fsi.com (Harry Rockefeller) wrote in message news:<d9a42677.0212281447.7d77da47@posting.google.com>...

: I was wondering why there was no response.  I think I
: misdiagnosed the problem and so will provide a bit more
: detail too.
: > I have a gentoo Linux system and applied the
: > bugzilla patch to get Ada built into gcc 3.2.1

The question seem to be almost a frequently asked question but as 
long as I can see there is no really good answer (this may explain
the silence). I hit the same problem (AFAIKS) -- gcc-3.x on Linux 
by default uses Dwarf-2 debugging format. It seems that Dwarf-2 
debugging does not work with gdb for Ada (and also Pascal). The 
good answer would be to implement the missing functionality (but
we are talking about free software so the one who needs it should
do the work...). 
There are two possible workarounds:
-- use stabs debug format (-gstabs or -gstabs+ instead of -g)
-- make gdb treat unknown language as C.

The first workaround requires that Ada runtime is compiled 
with -gstabs too, otherwise gdb dies when getting into runtime 
(actually I have not tried recompiling runtime, but checked that 
debugging seem to work as long as as stabs are used).
The second approach requires patching gdb (I did a little dirty hack
to this end, may post a patch if there is nothing better around), and
using C syntax (in particular using mangled names).      

I would like to hear about good answer (no, I have no plans to do 
more hacking on gdb). 

--
                              Waldek Hebisch
hebisch@math.uni.wroc.pl    or hebisch@hera.math.uni.wroc.pl 



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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-31 14:54 ` Harry Rockefeller
  2002-12-31 18:20   ` Waldek Hebisch
@ 2002-12-31 22:56   ` sk
  2003-01-02 14:54     ` Jerry van Dijk
  2003-01-01 20:46   ` Ed Cogburn
  2 siblings, 1 reply; 7+ messages in thread
From: sk @ 2002-12-31 22:56 UTC (permalink / raw)


Hi,

Cannot be of any concrete help since I use the GNAT 3.15p
package and I was unaware of "Gentoo" until you mentioned
it.

... however, a recent post (within last month) on cla
mentioned that there were issues with gcc 3,2 with respect
to Ada and the poster suggested using gcc 3.3. You might do
a google newsgroup search for some ideas followed by a
search of the gcc lists.

Sorry, no real help :-)


-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-31 14:54 ` Harry Rockefeller
  2002-12-31 18:20   ` Waldek Hebisch
  2002-12-31 22:56   ` sk
@ 2003-01-01 20:46   ` Ed Cogburn
  2 siblings, 0 replies; 7+ messages in thread
From: Ed Cogburn @ 2003-01-01 20:46 UTC (permalink / raw)


Harry Rockefeller wrote:
> harryr@ssd.fsi.com (Harry Rockefeller) wrote in message news:<d9a42677.0212281447.7d77da47@posting.google.com>...
> 
> I was wondering why there was no response.  I think I
> misdiagnosed the problem and so will provide a bit more
> detail too.
> 
> 
>>I have a gentoo Linux system and applied the
>>bugzilla patch to get Ada built into gcc 3.2.1
> 
> 
> The problem appears to be here.  When I run gdb 5.2.1 on
> the executable created I get an internal error -
> "unimplemented function unk_lang_create_fundamental_type called"
> when trying to set a breakpoint at a line in my Ada source.
> show lang and info extensions also seemed to indicate that gdb
> was not "Ada aware".



Yes, they are aware of this in the gdb group, because I did a google search on 
this error when I saw it and found some discussions about it.  The next gdb 
release should fix this problem, I'm sure.  I solved it by downloading the gdb 
source and applying a patch I found in one of those discussions to force gdb 
to treat it as the C language.  I didn't know about the -gstabs option Waldek 
mentioned, so I'll check that out.  Do a google search on 
"unk_lang_create_fundamental_type" and you'll find the discussions I found.




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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-31 22:56   ` sk
@ 2003-01-02 14:54     ` Jerry van Dijk
  0 siblings, 0 replies; 7+ messages in thread
From: Jerry van Dijk @ 2003-01-02 14:54 UTC (permalink / raw)



sk <sk@noname.com> writes:

> ... however, a recent post (within last month) on cla
> mentioned that there were issues with gcc 3,2 with respect
> to Ada and the poster suggested using gcc 3.3. You might do
> a google newsgroup search for some ideas followed by a
> search of the gcc lists.

Alas mingw does not have an ada-aware debugger. ACT is using cygwin
for the 3.15p release :-(

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   users.ncrvnet.nl/gmvdijk



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

* Re: gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does
  2002-12-31 18:20   ` Waldek Hebisch
@ 2003-01-02 16:03     ` Harry Rockefeller
  0 siblings, 0 replies; 7+ messages in thread
From: Harry Rockefeller @ 2003-01-02 16:03 UTC (permalink / raw)


hebisch@math.uni.wroc.pl (Waldek Hebisch) wrote in message news:<ausn5p$m8t$1@panorama.wcss.wroc.pl>...

> The question seem to be almost a frequently asked question but as 
> long as I can see there is no really good answer (this may explain
> the silence). I hit the same problem (AFAIKS) -- gcc-3.x on Linux 
> by default uses Dwarf-2 debugging format. It seems that Dwarf-2 
> debugging does not work with gdb for Ada (and also Pascal). The 
> good answer would be to implement the missing functionality (but
> we are talking about free software so the one who needs it should
> do the work...). 
> There are two possible workarounds:
> -- use stabs debug format (-gstabs or -gstabs+ instead of -g)
> -- make gdb treat unknown language as C.

The -gstabs option supplied to gcc 3.2.1 works for me.  I'm happy now.
Here is blurb from the gdb info page:

     _Warning:_ GDB can only debug C++ code if you use the proper
     compiler.  Typically, C++ debugging depends on the use of
     additional debugging information in the symbol table, and thus
     requires special support.  In particular, if your compiler
     generates a.out, MIPS ECOFF, RS/6000 XCOFF, or ELF with stabs
     extensions to the symbol table, these facilities are all
     available.  (With GNU CC, you can use the `-gstabs' option to
     request stabs debugging extensions explicitly.)  Where the object
     code format is standard COFF or DWARF in ELF, on the other hand,
     most of the C++ support in GDB does _not_ work.

Thank you for your help.



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

end of thread, other threads:[~2003-01-02 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-28 22:47 gdb 5.2.1 doesn't know Ada, gcc 3.2.1 does Harry Rockefeller
2002-12-31 14:54 ` Harry Rockefeller
2002-12-31 18:20   ` Waldek Hebisch
2003-01-02 16:03     ` Harry Rockefeller
2002-12-31 22:56   ` sk
2003-01-02 14:54     ` Jerry van Dijk
2003-01-01 20:46   ` Ed Cogburn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox