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; 13+ 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] 13+ messages in thread
[parent not found: <200405051830.03021.maa@liacc.up.pt>]
* How to debug?
@ 2004-05-05 17:30 Marius Amado Alves
  2004-05-05 20:12 ` Simon Wright
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Marius Amado Alves @ 2004-05-05 17:30 UTC (permalink / raw)
  To: comp.lang.ada

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?

I'm on Windows XP, with GNAT 3.15p. I tried GVD and gdb to no avail (yes, 
compiled with the -g option). Would it work on Linux?

Do I have to catch the exception, perhaps just to put a breakpoint in the 
handler?

Sometime ago, I think with GNAT 3.13p or 3.14p, I also tried instrumenting my 
code with GNAT's Symbolic_Traceback but it also didn't work. Would it work 
now with version 3.15p?

Would GPS do the trick?

Thanks a lot.

/* So far I seem to have been able to produce working Ada programs without a 
debugger. I instrument. But now I'm tired. And it's rather irritating that 
Ada, GNAT, the 'p' versions, does not facilitate debugging like e.g. the 
Borland products did. I miss that aspect of them. I whish there was a Turbo 
Ada. */






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

end of thread, other threads:[~2004-05-07  2:20 UTC | newest]

Thread overview: 13+ 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
     [not found] <200405051830.03021.maa@liacc.up.pt>
2004-05-05 18:27 ` How to debug? David C. Hoos
2004-05-05 20:17   ` Simon Wright
     [not found] ` <05ff01c432ce$9617a400$b101a8c0@sy.com>
2004-05-05 19:35   ` Marius Amado Alves
2004-05-05 19:20     ` Ludovic Brenta
2004-05-06 10:11 ` Marius Amado Alves
     [not found] ` <200405061111.02046.maa@liacc.up.pt>
2004-05-07  2:20   ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2004-05-05 17:30 Marius Amado Alves
2004-05-05 20:12 ` Simon Wright
2004-05-06 12:41 ` Matthew Heaney
2004-05-06 18:22 ` Pascal Obry

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