Changeset 167
- Timestamp:
- Feb 10, 2011, 4:07:44 PM (14 years ago)
- Location:
- ExceptionLogger
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
ExceptionLogger/UExceptionForm.lfm
r64 r167 10 10 OnDestroy = FormDestroy 11 11 OnShow = FormShow 12 LCLVersion = '0.9. 29'12 LCLVersion = '0.9.31' 13 13 object ButtonClose: TButton 14 14 Left = 611 … … 36 36 Top = 3 37 37 Width = 678 38 ActivePage = TabSheet 138 ActivePage = TabSheet2 39 39 Anchors = [akTop, akLeft, akRight, akBottom] 40 TabIndex = 040 TabIndex = 1 41 41 TabOrder = 2 42 42 object TabSheet1: TTabSheet … … 76 76 end 77 77 item 78 Caption = 'Line' 79 Width = 71 80 end 81 item 78 82 Caption = 'Class' 79 83 Width = 150 … … 86 90 Caption = 'Unit' 87 91 Width = 150 88 end89 item90 Caption = 'Line'91 Width = 7192 92 end> 93 ItemIndex = -194 93 ReadOnly = True 95 94 RowSelect = True -
ExceptionLogger/UExceptionForm.lrt
r40 r167 1 TEXCEPTIONFORM. EXCEPTIONFORM.CAPTION=Exception info1 TEXCEPTIONFORM.CAPTION=Exception info 2 2 TEXCEPTIONFORM.BUTTONCLOSE.CAPTION=Close 3 3 TEXCEPTIONFORM.BUTTONKILL.CAPTION=Terminate … … 6 6 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[0].CAPTION=Index 7 7 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[1].CAPTION=Address 8 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[2].CAPTION= Class9 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[3].CAPTION= Procedure/method10 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[4].CAPTION= Unit11 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[5].CAPTION= Line8 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[2].CAPTION=Line 9 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[3].CAPTION=Class 10 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[4].CAPTION=Procedure/method 11 TEXCEPTIONFORM.LISTVIEW1.COLUMNS[5].CAPTION=Unit 12 12 TEXCEPTIONFORM.CHECKBOXIGNORE.CAPTION=Next time ignore this exception -
ExceptionLogger/UExceptionForm.pas
r129 r167 81 81 Caption := IntToStr(Index); 82 82 SubItems.Add(IntToHex(Address, 8)); 83 SubItems.Add(IntToStr(LineNumber)); 83 84 SubItems.Add(FunctionClassName); 84 85 SubItems.Add(FunctionName); 85 86 SubItems.Add(Source); 86 SubItems.Add(IntToStr(LineNumber));87 87 end; 88 88 end; -
ExceptionLogger/UExceptionLogger.pas
r165 r167 140 140 141 141 procedure TExceptionLogger.ExceptionHandler(Sender: TObject; E: Exception); 142 var 143 Thread: TThread; 142 144 begin 143 145 BackTraceStrFunc := @StabBackTraceStr; -
ExceptionLogger/UStackTrace.pas
r39 r167 24 24 MaxDepth: Integer; 25 25 procedure GetExceptionBackTrace; 26 procedure GetCallStack; 26 procedure GetCallStack(BP: Pointer); 27 procedure GetCurrentCallStack; 27 28 constructor Create; 28 29 end; … … 54 55 end; 55 56 56 procedure TStackTrace.GetCallStack ;57 procedure TStackTrace.GetCallStack(BP: Pointer); 57 58 var 58 59 I: Longint; 59 60 prevbp: Pointer; 60 CallerFrame, 61 CallerAddress, 62 bp: Pointer; 61 CallerFrame: Pointer; 62 CallerAddress: Pointer; 63 63 StackFrameInfo: TStackFrameInfo; 64 64 begin 65 65 Clear; 66 //routine adapted from fpc source67 68 bp := get_frame;69 //This trick skip SendCallstack item70 // bp := get_caller_frame(get_frame);71 66 try 72 prevbp := bp - 1;73 67 I := 0; 74 //is_dev:=do_isdevice(textrec(f).Handle); 75 while bp > prevbp do begin 76 CallerAddress := get_caller_addr(bp); 77 CallerFrame := get_caller_frame(bp); 78 if (CallerAddress = nil) then 79 Break; 80 StackFrameInfo := TStackFrameInfo.Create; 81 StackFrameInfo.GetFrameInfo(CallerAddress); 82 StackFrameInfo.Index := I + 1; 83 Add(StackFrameInfo); 84 Inc(I); 85 if (I >= MaxDepth) or (CallerFrame = nil) then 86 Break; 87 prevbp := bp; 88 bp := CallerFrame; 89 end; 90 except 91 { prevent endless dump if an exception occured } 92 end; 68 while (BP <> nil) and (I < MaxDepth) do begin 69 CallerAddress := TStackFrameInfo(get_caller_addr(BP)); 70 StackFrameInfo := TStackFrameInfo.Create; 71 StackFrameInfo.GetFrameInfo(CallerAddress); 72 StackFrameInfo.Index := I + 1; 73 Add(StackFrameInfo); 74 Inc(I); 75 BP := TStackFrameInfo(get_caller_frame(BP)); 76 end; 77 except 78 { prevent endless dump if an exception occured } 79 end; 93 80 end; 94 81 … … 122 109 end; 123 110 124 111 procedure TStackTrace.GetCurrentCallStack; 112 begin 113 GetCallStack(get_frame); 114 end; 125 115 126 116 end.
Note:
See TracChangeset
for help on using the changeset viewer.