Is it possible to get call stack with function names in exception handler? lazarus / 12-Debugger ---------------------------------------------------------------------- vladimirku3n · 2010-04-26 13:47 Hi ALL, Is it possible to get call stack with function names in exception handler of Lazarus under Linux? There are many libraries which allow to do it for Delphi Windows but I can't find any for Lazarus Linux. Best Regards, Vladimir ---------------------------------------------------------------------- Dibo · 2010-06-02 11:50 I'm looking this too. Example, if my application have access violation error, then it must show in which function. It may be inefficient, because it's only for my test stage. ---------------------------------------------------------------------- Forest · 2010-07-25 14:01 Sure. Compile with -gl option (include debug info) Then set OnException handler like Application.OnException := @gExceptionHandler.EmailException;   in lpr or drop TApplicationProperties component on main form and use appropriate  event. for example this code should open e-mail client with prepared error notification data: (sowewhere in code....)  function SendShellEmail( ARecipientEmail, ASubject, ABody : string ) : boolean;     // Send an email to this recipient with a subject and a body     var       S       : string;     begin      If Trim(ARecipientEmail) = '' then        ARecipientEmail := 'mail';      S := 'mailto:' + ARecipientEmail;      S := S + '?subject=' + ASubject;      If Trim(ABody) <> '' then       S := S + '&body=' + ABody;      Result := OpenURL(S);     end; procedure TExceptionHandler.EmailException(Sender: TObject; E: Exception); var   x : string;   i: Integer;   Frames: PPointer;   S:String; begin     if E <> nil then       S:=E.ClassName+' - '+E.Message+'%0D%0A';     S:= S + BackTraceStrFunc(ExceptAddr);     Frames:=ExceptFrames;     for i:= 0 to ExceptFrameCount - 1 do       S:= S + ('%0D%0A'+BackTraceStrFunc(Frames));     x := 'Program exception! ' + '%0D%0A' +     'Stacktrace:' + '%0D%0A';     x := x + '%0D%0A' + '%0D%0A' +  S ;   SendShellEmail('your@crap.software.net','Program exception' +  ' ' + DateTimeToStr(Now),x);   Halt;//end of program execution end;