using package GNAT.Traceback 
Author Message
 using package GNAT.Traceback

Hi everyone, do you know how to use package GNAT.Traceback ?

In my source i write :

procedure IExplore is
   dummy : natural;
begin

   dummy := -1; -- will raise constraint_error

   exception when e: others =>
      declare
         tarray : Tracebacks_Array(1 .. 100);
         len : integer;
      begin
         Call_Chain(tarray, len);

         put_line("Callback number : " & integer'image(len));

      end;

end IExplore;

But i have the output :
Callback number :  0

I have gnat 3.12p under Win 2000 .
If someone knows the answer ...



Sun, 29 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback


Quote:
> Hi everyone, do you know how to use package GNAT.Traceback ?

Did you use the required switches for compile/bind, as
docmented in the GNAT documentation?

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 29 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback
Hmm...  Although reading the documentation is in general a good idea, the
"GNAT User's Guide" is not by any means the most fascinating set of 52,805
words available.  When the document is 155 pages of nitty gritty detail, I
would expect that there is a high probability that the existence of the -E
binder switch would be missed.  Now it would make sense that since you did
note that "this is only available on selected targets. Currently it is only
supported on Sparc/Solaris and x86/Linux." that you probably should have
made the comment that you needed to lookup the appropriate switches in the
user's guide.  Maybe GNAT should support a pragma Compile_Time_Assertion
which could be used the generate a custom warning message at compile time if
the switch settings are inappropriate.

-Chad R. Meiners


Quote:


> > Hi everyone, do you know how to use package GNAT.Traceback ?

> Did you use the required switches for compile/bind, as
> docmented in the GNAT documentation?

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sun, 29 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback
Thank you and I appologize, I didn't read the Gnat user's guide entirely.


Mon, 30 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback


Quote:
> Hmm...  Although reading the documentation is in general a
good idea, the
> "GNAT User's Guide" is not by any means the most fascinating
set of 52,805
> words available.  When the document is 155 pages of nitty
gritty detail, I
> would expect that there is a high probability that the
existence of the -E
> binder switch would be missed.

As I have noted MANY times in this forum, you should minimally
make sure you are aware of the various switches for the
compiler and binder. Use gnatmake and gnatbind with no
parameters to get a basic list.

Sent via Deja.com http://www.deja.com/
Before you buy.



Mon, 30 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback
My post wasn't meant to get an apology from you.  I was actually poking fun
at Dr. Dewar's question on whether or not you had read all the
documentation.  I was also suggesting that since GNAT.Traceback.Symbolic has
a comment that it is only supported on Sparc/Solaris and x86/Linux, the
package GNAT.Traceback should probably have a comment in it saying that it
requires a switch to be set.  Upon review of my post, I realise that this
was not clear so thus I am correcting myself.

-Chad R. Meiners


Quote:
> Thank you and I appologize, I didn't read the Gnat user's guide entirely.



Mon, 30 Sep 2002 03:00:00 GMT  
 using package GNAT.Traceback


Quote:
> My post wasn't meant to get an apology from you.  I was
actually poking fun
> at Dr. Dewar's question on whether or not you had read all the
> documentation.  I was also suggesting that since

GNAT.Traceback.Symbolic has

Quote:
> a comment that it is only supported on Sparc/Solaris and
x86/Linux, the
> package GNAT.Traceback should probably have a comment in it
saying that it
> requires a switch to be set.

GNAT.Traceback does NOT require the -E switch to be set, so
that comment is not there. I think there is quite a bit of
confusion here on what GNAT.Traceback does. This is fully
documented in the spec of the routine. The -E switch has
to do with storing tracebacks in exception occurrences,
which is something quite different.

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 01 Oct 2002 03:00:00 GMT  
 using package GNAT.Traceback


Quote:
> My post wasn't meant to get an apology from you.  I was
> actually poking fun at Dr. Dewar's question on whether or not
> you had read all the documentation.

I know that people are often allergic to reading documentation
these days, and expect to be able to point and click there
way by trial and error :-)

But compilers are complex tools, and if you want to get the
best out of *any* compiler technology, I strongly recommend
that you *do* in fact "read all the documentation". It is
always surprising to see people struggling when there is
a way that the compiler can help them solve their problem
if they would take the effort to read the documentation.

You can poke fun at this suggestion if you like, but it
remains a very good piece of advice :-)

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 01 Oct 2002 03:00:00 GMT  
 using package GNAT.Traceback

Quote:

> The -E switch has
> to do with storing tracebacks in exception occurrences,
> which is something quite different.

And this seems to require the `-funwind-tables' flag.  But why?  At
least glibc 2.1 has a backtrace() function which seems to provide the
same information without any compiler support, by walking down the
stack (obviously, you shouldn't use `-fomit-frame-pointer' to compile
your code, though).


Tue, 01 Oct 2002 03:00:00 GMT  
 using package GNAT.Traceback

Florian Weimer a crit dans le message

Quote:

>> The -E switch has
>> to do with storing tracebacks in exception occurrences,
>> which is something quite different.

>And this seems to require the `-funwind-tables' flag.  But why?  At
>least glibc 2.1 has a backtrace() function which seems to provide the
>same information without any compiler support, by walking down the
>stack (obviously, you shouldn't use `-fomit-frame-pointer' to compile
>your code, though).

There will be no need for -funwind-tables under Linux in the next GNAT
release.

Pascal.

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--|
--| "The best way to travel is by means of imagination"



Tue, 01 Oct 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Problem using Gnat.Traceback.Symbolic.Symbolic_Traceback()

2. Traceback on Gnat/Linux

3. Bug in GNAT.Traceback.Symbolic?

4. How to get a traceback in Gnat 3.14p

5. GNAT.Traceback is back...

6. Tracebacks, GNAT

7. GNAT/Ada Traceback Information?

8. GNAT exception traceback

9. perl script for GNAT tracebacks

10. GNAT : Exception traceback

11. import traceback destroys the traceback!

12. using package in a package

 

 
Powered by phpBB® Forum Software