comp.lang.ada
 help / color / mirror / Atom feed
* problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
@ 2002-03-28 11:17 nicolas
  2002-03-28 19:03 ` Simon Wright
  2002-04-02 21:08 ` David C. Hoos
  0 siblings, 2 replies; 6+ messages in thread
From: nicolas @ 2002-03-28 11:17 UTC (permalink / raw)


Hello
I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and Gnat
3.14p

the command issued is
gnatmake -f -funwind-tables -g test_trace.adb -bargs -E

I get ?? instead of unit names and line numbers

Note that everything works fine with the same command and Gnat 3.14p for
Sparc

Am I missing something obvious ? (other than Gnat 3.14p was not tested for
RedHAT 7.2,  I know that ...)

Thanks







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

* Re: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
  2002-03-28 11:17 problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ? nicolas
@ 2002-03-28 19:03 ` Simon Wright
  2002-04-02  9:14   ` nicolas
  2002-04-02 21:08 ` David C. Hoos
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Wright @ 2002-03-28 19:03 UTC (permalink / raw)


"nicolas" <n.brunot@cadwin.com> writes:

> I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and
> Gnat 3.14p
> 
> the command issued is
> gnatmake -f -funwind-tables -g test_trace.adb -bargs -E

Not sure why you've said -funwind-tables ?

> I get ?? instead of unit names and line numbers
> 
> Note that everything works fine with the same command and Gnat 3.14p
> for Sparc
> 
> Am I missing something obvious ? (other than Gnat 3.14p was not
> tested for RedHAT 7.2, I know that ...)

Someone was complaining about build problems on RH 7.2, related to
libaddr2line .. which is what converts addresses to line numbers
.. could be related.

My Slackware installations didn't come with libaddr2line, I copied one
from a binary GNAT installation.



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

* Re: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
  2002-03-28 19:03 ` Simon Wright
@ 2002-04-02  9:14   ` nicolas
  2002-04-02 18:18     ` Simon Wright
  0 siblings, 1 reply; 6+ messages in thread
From: nicolas @ 2002-04-02  9:14 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]


"Simon Wright" <simon@pushface.org> a �crit dans le message news:
x7vwuvwbjm7.fsf@smaug.pushface.org...
> "nicolas" <n.brunot@cadwin.com> writes:
>
> > I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and
> > Gnat 3.14p
> >
> > the command issued is
> > gnatmake -f -funwind-tables -g test_trace.adb -bargs -E
>
> Not sure why you've said -funwind-tables ?

I think I didn't use it with Gnat 3.13p and read somewhere that it is not
required.
But since Traceback doesn't work with Gnat 3.14 p , I followed what the Gnat
user's guide says (without success ...)

-E
Store tracebacks in exception occurrences when the target supports it. This
is the default with the zero cost exception mechanism. This option is
currently only supported on Solaris, Linux and Windows ix86. Under Solaris
and Linux you need to use explicitly the gcc flag -funwind-tables when
compiling every file in your application. See also the packages
GNAT.Traceback and GNAT.Traceback.Symbolic. Under Windows there is no
specific option to use to enable this feature but you must not
use -fomit-frame-pointer gcc option.







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

* Re: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
  2002-04-02  9:14   ` nicolas
@ 2002-04-02 18:18     ` Simon Wright
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Wright @ 2002-04-02 18:18 UTC (permalink / raw)


"nicolas" <n.brunot@cadwin.com> writes:

> "Simon Wright" <simon@pushface.org> a �crit dans le message news:
> x7vwuvwbjm7.fsf@smaug.pushface.org...
> > "nicolas" <n.brunot@cadwin.com> writes:
> >
> > > I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and
> > > Gnat 3.14p
> > >
> > > the command issued is
> > > gnatmake -f -funwind-tables -g test_trace.adb -bargs -E
> >
> > Not sure why you've said -funwind-tables ?
> 
> I think I didn't use it with Gnat 3.13p and read somewhere that it is not
> required.
> But since Traceback doesn't work with Gnat 3.14 p , I followed what the Gnat
> user's guide says (without success ...)
> 
> -E
> Store tracebacks in exception occurrences when the target supports it. This
> is the default with the zero cost exception mechanism. This option is
> currently only supported on Solaris, Linux and Windows ix86. Under Solaris
> and Linux you need to use explicitly the gcc flag -funwind-tables when
> compiling every file in your application. See also the packages
> GNAT.Traceback and GNAT.Traceback.Symbolic. Under Windows there is no
> specific option to use to enable this feature but you must not
> use -fomit-frame-pointer gcc option.

I know I'm using Slackware (7.1) and home-compiled GNATso my mileage
will vary from yours, but I get eg

   procedure Trace is
      procedure R (Depth : Integer);
      procedure R (Depth : Integer) is
      begin
         if Depth = 0 then
            raise Constraint_Error;
         else
            R (Depth - 1);
         end if;
      end R;
   begin
      R (10);
   end Trace;

compilation (with 3.14a1):

   smaug[19]$ GNAT_PREFIX=/opt/3.14a1 gnatmake trace -f -g -bargs -E
   gcc -c -g trace.adb
   gnatbind -aO./ -E -I- -x trace.ali
   gnatlink -g trace.ali

execution:
   smaug[20]$ trace

   Execution terminated by unhandled exception
   Exception name: CONSTRAINT_ERROR
   Message: trace.adb:6
   Call stack traceback locations:
   0x8049217 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x8049242 0x80491c9 0x40030575

traceback:
   smaug[21]$ addr2line -e trace 0x8049217 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x804922b 0x8049242 0x80491c9 0x40030575
   /home/simon/tmp/trace.adb:6
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:8
   /home/simon/tmp/trace.adb:12
   /home/simon/tmp/b~trace.adb:95
   /home/simon/gcc-2.8.1/./frame.c:0



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

* Re: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
  2002-03-28 11:17 problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ? nicolas
  2002-03-28 19:03 ` Simon Wright
@ 2002-04-02 21:08 ` David C. Hoos
  2002-04-03  8:46   ` nicolas
  1 sibling, 1 reply; 6+ messages in thread
From: David C. Hoos @ 2002-04-02 21:08 UTC (permalink / raw)


There is no problem with symbolic traceback on Linux with GNAT-3-14p,
in general.

There is, however, a small problem with some recent Linux distributions --
e.g., RedHat 7.2.

The problem is that there are two symbolic links
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-fsu/adalib/libbfd-2.9.5.0.
22.so
and
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-native/adalib/libbfd-2.9.5
.0.22.so

which link to /usr/lib/libbfd.so, which on RedHat 7.2 is a symbolic link to
libbfd-2.11.90.0.8.so

GNAT executables requiring symbolic traceback functionality that are built
with GNAT-3.14p will not work with  libbfd-2.11 -- they really require
libbfd-2.9, but the above chain of symbolic links causes the executable to
link to libbfd-2.11

Here are the steps I took to remedy the situation (for RedHat 7.2), doing
so in  such a way as to not disturb the environment for any executables
requiring libbfd-2.11:

1.  Copy libbfd-2.9.5.0.22 (e.g., from a RedHat 6.2 system) to
     /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/

2.  Delete the symbolic links

/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-fsu/adalib/libbfd-2.9.5.0.
22.so
     and

/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-native/adalib/libbfd-2.9.5
.0.22.so

3.  Replace those two links with links to ../../libbfd-2.9.5.0.22.so
     (This assumes you have already added
     /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib to
/etc/ld.so.conf)

4.  Execute the command ldconfig

5.  In each main program source code file add the following pragma:
     pragma Linker_Options

("/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/libbfd-2.9.5.0.22.so");

6.  Compile with a command like the following:
     gnatmake -i -g <main-program-name> -bargs -E \
    -cargs -gnatwl -funwind-tables -O3 -Wuninitialized -fstack-check

For what it's worth, I also use florist, so I moved the floristlib directory
to /usr/gnat/lib after building it.

Here is a small test program that will verify that symbolic tracebacks work,
following these instructions:

with Ada.Text_IO;
with GNAT.Traceback.Symbolic;
procedure Test_Traceback
is
   pragma Linker_Options
     ("/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/libbfd-2.9.5.0.22.so");
   File : Ada.Text_IO.File_Type;
begin
   Ada.Text_IO.Open
     (File => File,
      Name => "abcdefghijklmnopqrstuvwxyz",
      Mode => Ada.Text_IO.In_File);
exception
   when E: others =>
      Ada.Text_IO.Put_Line
        (Ada.Exceptions.Exception_Information (E) & ASCII.LF &
         "Symbolic call stack traceback locations:" & ASCII.LF &
         GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
end Test_Traceback;

I have been using gnat-3.14p since it became available on RedHat 6.2,
and 7.2, as well as Mandrake 7.1, with some very substantial programs
(one with 21 threads of execution) with excellent results.

David Hoos

----- Original Message -----
From: "nicolas" <n.brunot@cadwin.com>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Thursday, March 28, 2002 5:17 AM
Subject: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?


> Hello
> I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and Gnat
> 3.14p
>
> the command issued is
> gnatmake -f -funwind-tables -g test_trace.adb -bargs -E
>
> I get ?? instead of unit names and line numbers
>
> Note that everything works fine with the same command and Gnat 3.14p for
> Sparc
>
> Am I missing something obvious ? (other than Gnat 3.14p was not tested for
> RedHAT 7.2,  I know that ...)
>
> Thanks
>
>
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>





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

* Re: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
  2002-04-02 21:08 ` David C. Hoos
@ 2002-04-03  8:46   ` nicolas
  0 siblings, 0 replies; 6+ messages in thread
From: nicolas @ 2002-04-03  8:46 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4509 bytes --]

Thanks for the explanation.

Actually what I did was

1/ I copied libbfd-2.9.5.0.22.so in
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1
2/ I added /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1 in /etc/ld.so.conf
3/ I run ldconfig

I add
-largs /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/libbfd-2.9.5.0.22.so
 to the gnatmake command
Everything is ok now without changing links or adding pragma linker_options
in the code
(Our code is common for several platforms and Ada compilers)


"David C. Hoos" <david.c.hoos.sr@ada95.com> a �crit dans le message news:
mailman.1017781803.29333.comp.lang.ada@ada.eu.org...
> There is no problem with symbolic traceback on Linux with GNAT-3-14p,
> in general.
>
> There is, however, a small problem with some recent Linux distributions --
> e.g., RedHat 7.2.
>
> The problem is that there are two symbolic links
>
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-fsu/adalib/libbfd-2.9.5.0.
> 22.so
> and
>
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-native/adalib/libbfd-2.9.5
> .0.22.so
>
> which link to /usr/lib/libbfd.so, which on RedHat 7.2 is a symbolic link
to
> libbfd-2.11.90.0.8.so
>
> GNAT executables requiring symbolic traceback functionality that are built
> with GNAT-3.14p will not work with  libbfd-2.11 -- they really require
> libbfd-2.9, but the above chain of symbolic links causes the executable to
> link to libbfd-2.11
>
> Here are the steps I took to remedy the situation (for RedHat 7.2), doing
> so in  such a way as to not disturb the environment for any executables
> requiring libbfd-2.11:
>
> 1.  Copy libbfd-2.9.5.0.22 (e.g., from a RedHat 6.2 system) to
>      /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/
>
> 2.  Delete the symbolic links
>
>
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-fsu/adalib/libbfd-2.9.5.0.
> 22.so
>      and
>
>
/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/rts-native/adalib/libbfd-2.9.5
> .0.22.so
>
> 3.  Replace those two links with links to ../../libbfd-2.9.5.0.22.so
>      (This assumes you have already added
>      /usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib to
> /etc/ld.so.conf)
>
> 4.  Execute the command ldconfig
>
> 5.  In each main program source code file add the following pragma:
>      pragma Linker_Options
>
> ("/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/libbfd-2.9.5.0.22.so");
>
> 6.  Compile with a command like the following:
>      gnatmake -i -g <main-program-name> -bargs -E \
>     -cargs -gnatwl -funwind-tables -O3 -Wuninitialized -fstack-check
>
> For what it's worth, I also use florist, so I moved the floristlib
directory
> to /usr/gnat/lib after building it.
>
> Here is a small test program that will verify that symbolic tracebacks
work,
> following these instructions:
>
> with Ada.Text_IO;
> with GNAT.Traceback.Symbolic;
> procedure Test_Traceback
> is
>    pragma Linker_Options
>
("/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/libbfd-2.9.5.0.22.so");
>    File : Ada.Text_IO.File_Type;
> begin
>    Ada.Text_IO.Open
>      (File => File,
>       Name => "abcdefghijklmnopqrstuvwxyz",
>       Mode => Ada.Text_IO.In_File);
> exception
>    when E: others =>
>       Ada.Text_IO.Put_Line
>         (Ada.Exceptions.Exception_Information (E) & ASCII.LF &
>          "Symbolic call stack traceback locations:" & ASCII.LF &
>          GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
> end Test_Traceback;
>
> I have been using gnat-3.14p since it became available on RedHat 6.2,
> and 7.2, as well as Mandrake 7.1, with some very substantial programs
> (one with 21 threads of execution) with excellent results.
>
> David Hoos
>
> ----- Original Message -----
> From: "nicolas" <n.brunot@cadwin.com>
> Newsgroups: comp.lang.ada
> To: <comp.lang.ada@ada.eu.org>
> Sent: Thursday, March 28, 2002 5:17 AM
> Subject: problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ?
>
>
> > Hello
> > I have problems with Gnat.Traceback.Symbolic on Linux RedHAT 7.2 and
Gnat
> > 3.14p
> >
> > the command issued is
> > gnatmake -f -funwind-tables -g test_trace.adb -bargs -E
> >
> > I get ?? instead of unit names and line numbers
> >
> > Note that everything works fine with the same command and Gnat 3.14p for
> > Sparc
> >
> > Am I missing something obvious ? (other than Gnat 3.14p was not tested
for
> > RedHAT 7.2,  I know that ...)
> >
> > Thanks
> >
> >
> >
> >
> > _______________________________________________
> > comp.lang.ada mailing list
> > comp.lang.ada@ada.eu.org
> > http://ada.eu.org/mailman/listinfo/comp.lang.ada
> >
>
>





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

end of thread, other threads:[~2002-04-03  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-28 11:17 problem with Gnat.Traceback.Symbolic on linux with Gnat 3.14p ? nicolas
2002-03-28 19:03 ` Simon Wright
2002-04-02  9:14   ` nicolas
2002-04-02 18:18     ` Simon Wright
2002-04-02 21:08 ` David C. Hoos
2002-04-03  8:46   ` nicolas

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