1

Using GNATMAKE 3.13a1 (20000509), the following function seems to produce no result. That is the log messages are never written to the log, nor is the stack-trace logged.

The surrounding logs, perform normally.

procedure log_Stack_Trace( label : in  String;
                           memo  : in  String := "" )
is
    length : Natural := 16;
    trace  : GNAT.Traceback.Tracebacks_Array( 1..length );
begin
    trace_Debug( "--- Stacktrace [" & label & "] ---" );
    if ( "" /= memo )
    then
        trace_Debug( "---" & memo );
    end if;

    GNAT.Traceback.Call_Chain( trace, length );
    trace_Debug( GNAT.Traceback.Symbolic.Symbolic_Traceback( trace( 1..length ) ) );

end log_Stack_Trace;

Calling this procedure like ~

    trace_Debug( "Before stack-trace" );
    log_Stack_Trace( "HELLOOOO?" );
    trace_Debug( "After stack-trace" );

Only gives me the log-output:

Before stack-trace
After stack-trace

The --- Stacktrace [ ... ] --- heading message (etc.) is never logged.

Is there something peculiar to GNat / Ada95 causing this? Do I have to actually have an exception to get a stack-trace (or suchlike?).

Zerte
  • 1,478
  • 10
  • 9
Kingsley
  • 14,398
  • 5
  • 31
  • 53
  • 3
    That's a 20 year old compiler... if you're in the US, it'll be old enough to drink next year. Time for an upgrade? –  Feb 14 '20 at 09:17
  • You are using a version of GNAT that is almost 20 years old. Is there a reason for that? – Zerte Feb 14 '20 at 09:17
  • I agree it's an old compiler, but that's the environment I inherited. It's for an audited safety-system, so it's not so easy to just dump the compiler for a newer one. – Kingsley Feb 16 '20 at 21:24

0 Answers0