FpDebug: Context for unknown location

git-svn-id: trunk@63363 -
This commit is contained in:
martin 2020-06-16 19:57:27 +00:00
parent edc614596e
commit c41f071d7b
2 changed files with 58 additions and 0 deletions

View File

@ -1680,6 +1680,9 @@ begin
exit;
Result := FDbgInfo.FindContext(AThreadId, AStackFrame, Addr);
// SymbolTableInfo.FindContext()
if Result = nil then
Result := TFpDbgInfoSimpleContext.Create(MemManager, Addr, DBGPTRSIZE[Mode], AThreadId, AStackFrame);
end;
function TDbgProcess.FindContext(AAddress: TDbgPtr): TFpDbgInfoContext;

View File

@ -486,6 +486,25 @@ type
property MemManager: TFpDbgMemManager read GetMemManager;
end;
{ TFpDbgInfoSimpleContext }
TFpDbgInfoSimpleContext = class(TFpDbgInfoContext)
private
FMemManager: TFpDbgMemManager;
FAddress: TDbgPtr;
FThreadId: Integer;
FStackFrame: Integer;
FSizeOfAddr: Integer;
protected
function GetMemManager: TFpDbgMemManager; override;
function GetAddress: TDbgPtr; override;
function GetThreadId: Integer; override;
function GetStackFrame: Integer; override;
function GetSizeOfAddress: Integer; override;
public
constructor Create(AMemManager: TFpDbgMemManager; AnAddress: TDbgPtr; AnSizeOfAddr, AThreadId: Integer; AStackFrame: Integer);
end;
{ TDbgInfo }
TDbgInfo = class(TObject)
@ -949,6 +968,42 @@ begin
Result := nil;
end;
function TFpDbgInfoSimpleContext.GetMemManager: TFpDbgMemManager;
begin
Result := FMemManager;
end;
function TFpDbgInfoSimpleContext.GetAddress: TDbgPtr;
begin
Result := fAddress;
end;
function TFpDbgInfoSimpleContext.GetThreadId: Integer;
begin
Result := fThreadId;
end;
function TFpDbgInfoSimpleContext.GetStackFrame: Integer;
begin
Result := fStackFrame;
end;
function TFpDbgInfoSimpleContext.GetSizeOfAddress: Integer;
begin
Result := FSizeOfAddr;
end;
constructor TFpDbgInfoSimpleContext.Create(AMemManager: TFpDbgMemManager;
AnAddress: TDbgPtr; AnSizeOfAddr, AThreadId: Integer; AStackFrame: Integer);
begin
AddReference;
FMemManager := AMemManager;
FAddress := AnAddress;
FSizeOfAddr := AnSizeOfAddr;
FThreadId := AThreadId;
FStackFrame := AStackFrame;
end;
{ TFpSymbol }
constructor TFpSymbol.Create(const AName: String);