comp.lang.ada
 help / color / mirror / Atom feed
* Re: How to debug?
@ 2004-05-06 14:10 Jerry van Dijk
  2004-05-06 15:13 ` Marius Amado Alves
       [not found] ` <200405061613.44915.maa@liacc.up.pt>
  0 siblings, 2 replies; 3+ messages in thread
From: Jerry van Dijk @ 2004-05-06 14:10 UTC (permalink / raw)



> How do I inspect the call stack (preferably symbolic information i.e. source
> code unit name + line number + subprogram names), upon an unhandled
> exception occurrence?

Maybe you have an installation problem ?

If I follow the instructions in chapter 23.13.2.1 (Tracebacks From Exception 
Occurrences) in the GNAT 3.15p user manual it works:

-------------------------------------------------------------------------------
C:\home\work>cat stb.adb
with Ada.Text_IO;
with GNAT.Traceback.Symbolic;

procedure STB is

   procedure P1 is
   begin
      raise Constraint_Error;
   end P1;

   procedure P2 is
   begin
      P1;
   end P2;

   procedure P3 is
   begin
      P2;
   end P3;

begin
   P3;
exception
   when E : others =>
      Ada.Text_IO.Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
end STB;

C:\home\work>gnatmake -g stb -bargs -E -largs -lgnat -laddr2line -lintl
gcc -c -g stb.adb
gnatbind -aO./ -E -I- -x stb.ali
gnatlink -g -lgnat -laddr2line -lintl stb.ali

C:\home\work>stb
00404F61 in ada.exceptions.process_raise_exception at a-except.adb:1320
004020D7 in <__gnat_rcheck_04> at a-except.adb:592
004015A7 in stb.p1 at stb.adb:8
004015BF in stb.p2 at stb.adb:13
004015D7 in stb.p3 at stb.adb:18
004017F1 in stb at stb.adb:22
004013CF in main at b~stb.adb:168
00401103 in ?? at fake:0
-------------------------------------------------------------------------------

-- 
--  Jerry van Dijk
--  Leiden, Holland 



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

end of thread, other threads:[~2004-05-06 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-06 14:10 How to debug? Jerry van Dijk
2004-05-06 15:13 ` Marius Amado Alves
     [not found] ` <200405061613.44915.maa@liacc.up.pt>
2004-05-06 18:35   ` How to debug? (solved) Marius Amado Alves

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