From f9810a261180960cba13c6430497964c9d60e189 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 9 Oct 2011 22:35:49 +0000 Subject: [PATCH] DBG: Improved exception feedback git-svn-id: trunk@32793 - --- debugger/gdbmidebugger.pp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/debugger/gdbmidebugger.pp b/debugger/gdbmidebugger.pp index daf5943139..25129575e5 100644 --- a/debugger/gdbmidebugger.pp +++ b/debugger/gdbmidebugger.pp @@ -5988,7 +5988,9 @@ begin ClearSourceInfo; FPauseWaitState := pwsNone; // clear un-needed commands - CancelAfterStop; + if State = dsError + then CancelAllQueued + else CancelAfterStop; end; if (State = dsError) and (DebugProcessRunning) then begin SendCmdLn('kill'); // try to kill the debugged process. bypass all queues. @@ -10527,7 +10529,7 @@ function TGDBMIDebuggerCommand.Execute: Boolean; var I: Integer; Frames: PPointer; - Report: string; + Report, Report2: string; begin // Set the state first, so DoExecute can set an error-state SetCommandState(dcsExecuting); @@ -10541,16 +10543,19 @@ begin try debugln(['ERROR: Exception occured in DoExecute '+e.ClassName + ' Msg="'+ e.Message + '" Addr=', dbgs(ExceptAddr)]); Report := BackTraceStrFunc(ExceptAddr); + Report2 := Report; Frames := ExceptFrames; for I := 0 to ExceptFrameCount - 1 do Report := Report + LineEnding + BackTraceStrFunc(Frames[I]); + if i < 5 + then Report2 := Report; except end; debugln(Report); if MessageDlg('The debugger experienced an unknown condition.', - Format('Press "Ignore" to continue debugging. This may NOT be save. Press "Abort to stop the debugger. %s' - +'Exception: %s.with message "%s"', - [LineEnding, e.ClassName, e.Message]), + Format('Press "Ignore" to continue debugging. This may NOT be save. Press "Abort to stop the debugger. %0:s' + +'Exception: %1:s.with message "%2:s"%0:s%0:s%3:s', + [LineEnding, e.ClassName, e.Message, Report2]), mtWarning, [mbIgnore, mbAbort], 0, mbAbort) = mrAbort then begin try