Kingsley
Kingsley

Reputation: 14906

Ada95 Traceback function produces no output

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

Upvotes: 1

Views: 154

Answers (0)

Related Questions