Contains types and routines used to implement exceptions and stack traces.

laztracer.pas contains types and routines used to implement exceptions and stack traces in the Lazarus IDE and Debugger. This file is part of the LazUtils package.

Array type used for Pointers to code addresses.

TStackTracePointers is an Array type which contains Pointers to code addresses. TStackTracePointers is the type passed as an argument to the GetStackTracePointers and StackTraceAsString routines. It is also the type used to implement the CreationStack and DestructionStack members in TDebugLCLItemInfo.

TDebugLCLItemInfo
Record type used to store a pointer to a code address and its additional information. Pointer to the address for a source code symbol. Contains additional information about the code address and its origin. Pointer to a TLineInfoCacheItem type.

Used in the implementation of the GetLineInfo routine.

Raises an exception in the GDB debugger.

RaiseGDBException is a procedure used to raise an exception in the GDB debugger. Normally, GDB does not catch FPC Exception objects. This procedure raises a standard "Division By Zero" exception, which IS caught by GDB. This allows a program to be stopped in the debugger without extra GDB configuration.

For the Amiga platform, Division by Zero errors are not catchable. The program will simply crash.

Msg contains the value used as the message in the exception.

Value for the message in the exception. Raises an exception that is caught and handled in an application.

RaiseAndCatchException is a procedure used to generate an Exception that is caught and handled by an application.

For the Amiga platform, Division by Zero errors are not catchable. The program will simply crash.
Retrieves backtrace information for code addresses.

GetStackTrace is a String function used to retrieve backtrace information for code addresses in a string format.

Calls GetLineInfo to get information for the code addresses, using the value in UseCache as an argument. UseCache indicates if cached line information from an internal AVL tree can be used in the routine. When UseCache contains False, the BackTraceStrFunc in lclproc.pas initialization section is called to get the line information for each of the backtrace addresses.

String with information about backtrace addresses. Indicates if cached line information can be used in the routine. Retrieve the addresses and information for a code address and its callers.

GetStackTracePointers is a procedure used to retrieve the addresses and information for a code address and its callers.

AStack is the array where pointers to code addresses for calling routines are stored.

Array where pointers to code addresses are stored. Gets a string with backtrace information for the specified call stack.

StackTraceAsString is a String function used to get backtrace information for the code addresses specified in AStack. The return value contains lines with the values from GetLineInfo for each of the code addresses.

UseCache indicates if cached line information from an internal AVL tree can be used in the routine. It is passed as an argument in calls to the GetLineInfo routine.

String with backtrace information for the call stack. Array of pointers to code addresses examined in the routine. Indicates if cached line information can be used in the routine. Gets information about the specified code address.

GetLineInfo is a String function used to get information about the code address specified in Addr.

UseCache indicates if cached line information from an internal AVL tree can be used in the routine. When UseCache contains False, the BackTraceStrFunc in the lclproc.pas initialization section is called to get the line information for each of the backtrace addresses.

String with information about the code address. The code address examined in the routine. Indicates if locally cached line information can be used in the routine.