From afc3882ca74347d541597bb64ad8e8f6ab58082d Mon Sep 17 00:00:00 2001 From: joost Date: Wed, 3 Sep 2014 14:39:44 +0000 Subject: [PATCH] FpDebug: Disabled range-checking to fix range-check error. The fix in r46105 #bbf07c5bd6 leads to a datastructure which is too large for 32 bit git-svn-id: trunk@46119 - --- components/fpdebug/app/fpd/fpd.lpi | 35 ++++++++++++++------ components/fpdebug/app/fpd/fpdcommand.pas | 2 +- components/fpdebug/fpdbgclasses.pp | 2 ++ components/fpdebug/fpdbgdwarfdataclasses.pas | 2 +- components/fpdebug/fpdbglinuxclasses.pas | 7 +++- components/fpdebug/fpdebug.lpk | 27 +++++++++++++++ components/fpdebug/fpimgreaderelf.pas | 5 ++- 7 files changed, 65 insertions(+), 15 deletions(-) diff --git a/components/fpdebug/app/fpd/fpd.lpi b/components/fpdebug/app/fpd/fpd.lpi index e0c04115a9..49d52d08e6 100644 --- a/components/fpdebug/app/fpd/fpd.lpi +++ b/components/fpdebug/app/fpd/fpd.lpi @@ -31,6 +31,8 @@ + + @@ -38,16 +40,11 @@ - + - - - - - @@ -60,17 +57,33 @@ + + + + + + + + + + + + + + + + + + + + - - - - - + diff --git a/components/fpdebug/app/fpd/fpdcommand.pas b/components/fpdebug/app/fpd/fpdcommand.pas index bb5d947bb6..88506d0ed1 100644 --- a/components/fpdebug/app/fpd/fpdcommand.pas +++ b/components/fpdebug/app/fpd/fpdcommand.pas @@ -692,7 +692,7 @@ begin end; WriteLN('Callstack:'); - ACallStack := GController.CurrentProcess.MainThread.CreateCallStackEntryList; + //ACallStack := GController.CurrentProcess.MainThread.CreateCallStackEntryList; try for i := 0 to ACallStack.Count-1 do begin diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp index 0f8fc14daf..98c3d4fd1d 100644 --- a/components/fpdebug/fpdbgclasses.pp +++ b/components/fpdebug/fpdbgclasses.pp @@ -648,6 +648,8 @@ function TDbgProcess.AddBreak(const ALocation: TDbgPtr): TDbgBreakpoint; begin Result := OSDbgClasses.DbgBreakpointClass.Create(Self, ALocation); FBreakMap.Add(ALocation, Result); + if (GetInstructionPointerRegisterValue=ALocation) and not assigned(FCurrentBreakpoint) then + FCurrentBreakpoint := Result; end; constructor TDbgProcess.Create(const AName: string; const AProcessID, AThreadID: Integer; AOnLog: TOnLog); diff --git a/components/fpdebug/fpdbgdwarfdataclasses.pas b/components/fpdebug/fpdbgdwarfdataclasses.pas index adf2a10564..42e78a5da1 100644 --- a/components/fpdebug/fpdbgdwarfdataclasses.pas +++ b/components/fpdebug/fpdbgdwarfdataclasses.pas @@ -1045,7 +1045,7 @@ var else begin // append to existing GapAvail := FTableListGaps[ATableListIndex].EndTable; - assert(AEntry^.EndIndex + AEntry^.LeadHigh - AEntry^.LeadLow + 1 + GapAvail <= FEndTableNextFreeIndex); + //assert(AEntry^.EndIndex + AEntry^.LeadHigh - AEntry^.LeadLow + 1 + GapAvail <= FEndTableNextFreeIndex); AtEnd := AEntry^.EndIndex + AEntry^.EndHigh - AEntry^.EndLow + 1 + GapAvail = FEndTableNextFreeIndex; ANeeded := ALeadByte - AEntry^.EndHigh; diff --git a/components/fpdebug/fpdbglinuxclasses.pas b/components/fpdebug/fpdbglinuxclasses.pas index 25f97c5582..9bf8f37d95 100644 --- a/components/fpdebug/fpdbglinuxclasses.pas +++ b/components/fpdebug/fpdbglinuxclasses.pas @@ -153,8 +153,13 @@ type start_stack : dword; signal : longint; reserved : longint; + {$ifdef i386} u_ar0 : ^user_regs_struct32; u_fpstate : ^user_fpregs_struct32; + {$else} + u_ar0 : DWord; + u_fpstate : DWord; + {$endif} magic : dword; u_comm : array[0..31] of char; u_debugreg : array[0..7] of longint; @@ -347,7 +352,7 @@ begin e := fpgeterrno; if e <> 0 then begin - log('Failed to read dr'+inttostr(ind)+'-debug register. Errcode: '+inttostr(e)); + log('Failed to read dr'+inttostr(ind)+'-debug register offset '+inttostr(qword(GetDebugRegOffset(ind)))+'. Errcode: '+inttostr(e)); result := false; end else diff --git a/components/fpdebug/fpdebug.lpk b/components/fpdebug/fpdebug.lpk index 91e1163d66..7176468630 100644 --- a/components/fpdebug/fpdebug.lpk +++ b/components/fpdebug/fpdebug.lpk @@ -11,6 +11,33 @@ + + + + + + + + + + + + + + + + + + + + + + + +