comp.lang.ada
 help / color / mirror / Atom feed
* using package GNAT.Traceback
@ 2000-04-12  0:00 Christophe Gouiran
  2000-04-12  0:00 ` Robert Dewar
  0 siblings, 1 reply; 10+ messages in thread
From: Christophe Gouiran @ 2000-04-12  0:00 UTC (permalink / raw)


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 ...






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

* Re: using package GNAT.Traceback
  2000-04-12  0:00 using package GNAT.Traceback Christophe Gouiran
@ 2000-04-12  0:00 ` Robert Dewar
  2000-04-12  0:00   ` Chad R. Meiners
  0 siblings, 1 reply; 10+ messages in thread
From: Robert Dewar @ 2000-04-12  0:00 UTC (permalink / raw)


In article <C01J4.377$ev4.340097@nnrp4.proxad.net>,
  "Christophe Gouiran" <christophe@e-motive.com> wrote:

> 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.




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

* Re: using package GNAT.Traceback
  2000-04-12  0:00 ` Robert Dewar
@ 2000-04-12  0:00   ` Chad R. Meiners
  2000-04-13  0:00     ` Robert Dewar
  2000-04-13  0:00     ` Christophe Gouiran
  0 siblings, 2 replies; 10+ messages in thread
From: Chad R. Meiners @ 2000-04-12  0:00 UTC (permalink / raw)


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

"Robert Dewar" <robert_dewar@my-deja.com> wrote in message
news:8d2dan$202$1@nnrp1.deja.com...
> In article <C01J4.377$ev4.340097@nnrp4.proxad.net>,
>   "Christophe Gouiran" <christophe@e-motive.com> wrote:
>
> > 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.






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

* Re: using package GNAT.Traceback
  2000-04-12  0:00   ` Chad R. Meiners
@ 2000-04-13  0:00     ` Robert Dewar
  2000-04-13  0:00     ` Christophe Gouiran
  1 sibling, 0 replies; 10+ messages in thread
From: Robert Dewar @ 2000-04-13  0:00 UTC (permalink / raw)


In article <38f4cb4c.0@silver.truman.edu>,
  "Chad R. Meiners" <crmeiners@hotmail.com> wrote:
> 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.




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

* Re: using package GNAT.Traceback
  2000-04-13  0:00     ` Christophe Gouiran
@ 2000-04-13  0:00       ` Chad R. Meiners
  2000-04-14  0:00         ` Robert Dewar
  2000-04-14  0:00         ` Robert Dewar
  0 siblings, 2 replies; 10+ messages in thread
From: Chad R. Meiners @ 2000-04-13  0:00 UTC (permalink / raw)


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

"Christophe Gouiran" <christophe@e-motive.com> wrote in message
news:SseJ4.530$%H6.752697@nnrp4.proxad.net...
> Thank you and I appologize, I didn't read the Gnat user's guide entirely.
>
>






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

* Re: using package GNAT.Traceback
  2000-04-12  0:00   ` Chad R. Meiners
  2000-04-13  0:00     ` Robert Dewar
@ 2000-04-13  0:00     ` Christophe Gouiran
  2000-04-13  0:00       ` Chad R. Meiners
  1 sibling, 1 reply; 10+ messages in thread
From: Christophe Gouiran @ 2000-04-13  0:00 UTC (permalink / raw)


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






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

* Re: using package GNAT.Traceback
  2000-04-13  0:00       ` Chad R. Meiners
  2000-04-14  0:00         ` Robert Dewar
@ 2000-04-14  0:00         ` Robert Dewar
  2000-04-14  0:00           ` Florian Weimer
  1 sibling, 1 reply; 10+ messages in thread
From: Robert Dewar @ 2000-04-14  0:00 UTC (permalink / raw)


In article <38f5d0ef.0@silver.truman.edu>,
  "Chad R. Meiners" <crmeiners@hotmail.com> wrote:
> 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.

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.




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

* Re: using package GNAT.Traceback
  2000-04-13  0:00       ` Chad R. Meiners
@ 2000-04-14  0:00         ` Robert Dewar
  2000-04-14  0:00         ` Robert Dewar
  1 sibling, 0 replies; 10+ messages in thread
From: Robert Dewar @ 2000-04-14  0:00 UTC (permalink / raw)


In article <38f5d0ef.0@silver.truman.edu>,
  "Chad R. Meiners" <crmeiners@hotmail.com> wrote:

> 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.




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

* Re: using package GNAT.Traceback
  2000-04-14  0:00         ` Robert Dewar
@ 2000-04-14  0:00           ` Florian Weimer
  2000-04-14  0:00             ` Pascal Obry
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Weimer @ 2000-04-14  0:00 UTC (permalink / raw)


Robert Dewar <robert_dewar@my-deja.com> writes:

> 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).




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

* Re: using package GNAT.Traceback
  2000-04-14  0:00           ` Florian Weimer
@ 2000-04-14  0:00             ` Pascal Obry
  0 siblings, 0 replies; 10+ messages in thread
From: Pascal Obry @ 2000-04-14  0:00 UTC (permalink / raw)


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


Florian Weimer a �crit dans le message
<87r9c8wkjk.fsf@deneb.cygnus.argh.org>...
>Robert Dewar <robert_dewar@my-deja.com> writes:
>
>> 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"








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

end of thread, other threads:[~2000-04-14  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-12  0:00 using package GNAT.Traceback Christophe Gouiran
2000-04-12  0:00 ` Robert Dewar
2000-04-12  0:00   ` Chad R. Meiners
2000-04-13  0:00     ` Robert Dewar
2000-04-13  0:00     ` Christophe Gouiran
2000-04-13  0:00       ` Chad R. Meiners
2000-04-14  0:00         ` Robert Dewar
2000-04-14  0:00         ` Robert Dewar
2000-04-14  0:00           ` Florian Weimer
2000-04-14  0:00             ` Pascal Obry

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