mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 09:40:28 +02:00
FpDebug: FPC sets some lines to line-num=0 => map them to the next avail line. This will at least be somewhere around the correct location.
git-svn-id: trunk@62337 -
This commit is contained in:
parent
f64a5f7d3b
commit
2dd36b3cd8
@ -1876,6 +1876,7 @@ end;
|
|||||||
function TDbgThread.CompareStepInfo(AnAddr: TDBGPtr): TFPDCompareStepInfo;
|
function TDbgThread.CompareStepInfo(AnAddr: TDBGPtr): TFPDCompareStepInfo;
|
||||||
var
|
var
|
||||||
Sym: TFpSymbol;
|
Sym: TFpSymbol;
|
||||||
|
l: TDBGPtr;
|
||||||
begin
|
begin
|
||||||
if FStoreStepSrcLineNo = -1 then begin // stepping from location with no line info
|
if FStoreStepSrcLineNo = -1 then begin // stepping from location with no line info
|
||||||
Result := dcsiNewLine;
|
Result := dcsiNewLine;
|
||||||
@ -1887,12 +1888,16 @@ begin
|
|||||||
sym := FProcess.FindProcSymbol(AnAddr);
|
sym := FProcess.FindProcSymbol(AnAddr);
|
||||||
if assigned(sym) then
|
if assigned(sym) then
|
||||||
begin
|
begin
|
||||||
debugln(FPDBG_COMMANDS, ['CompareStepInfo @IP=',AnAddr,' ',sym.FileName, ':',sym.Line, ' in ',sym.Name, ' @Func=',sym.Address.Address]);
|
if sym is TFpSymbolDwarfDataProc then
|
||||||
if (((FStoreStepSrcFilename=sym.FileName) and (FStoreStepSrcLineNo=sym.Line)) {or FStepOut}) then
|
l := TFpSymbolDwarfDataProc(sym).LineUnfixed
|
||||||
|
else
|
||||||
|
l := Sym.Line;
|
||||||
|
debugln(FPDBG_COMMANDS, ['CompareStepInfo @IP=',AnAddr,' ',sym.FileName, ':',l, ' in ',sym.Name, ' @Func=',sym.Address.Address]);
|
||||||
|
if (((FStoreStepSrcFilename=sym.FileName) and (FStoreStepSrcLineNo=l)) {or FStepOut}) then
|
||||||
result := dcsiSameLine
|
result := dcsiSameLine
|
||||||
else if sym.FileName = '' then
|
else if sym.FileName = '' then
|
||||||
result := dcsiNoLineInfo
|
result := dcsiNoLineInfo
|
||||||
else if sym.Line = 0 then
|
else if l = 0 then
|
||||||
result := dcsiZeroLine
|
result := dcsiZeroLine
|
||||||
else
|
else
|
||||||
result := dcsiNewLine;
|
result := dcsiNewLine;
|
||||||
@ -1935,10 +1940,14 @@ begin
|
|||||||
sym := FProcess.FindProcSymbol(AnAddr);
|
sym := FProcess.FindProcSymbol(AnAddr);
|
||||||
if assigned(sym) then
|
if assigned(sym) then
|
||||||
begin
|
begin
|
||||||
debugln(FPDBG_COMMANDS, ['StoreStepInfo @IP=',AnAddr,' ',sym.FileName, ':',sym.Line, ' in ',sym.Name, ' @Func=',sym.Address.Address]);
|
|
||||||
FStoreStepSrcFilename:=sym.FileName;
|
FStoreStepSrcFilename:=sym.FileName;
|
||||||
FStoreStepSrcLineNo:=sym.Line;
|
|
||||||
FStoreStepFuncAddr:=sym.Address.Address;
|
FStoreStepFuncAddr:=sym.Address.Address;
|
||||||
|
if sym is TFpSymbolDwarfDataProc then begin
|
||||||
|
FStoreStepSrcLineNo := TFpSymbolDwarfDataProc(sym).LineUnfixed;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
FStoreStepSrcLineNo:=sym.Line;
|
||||||
|
debugln(FPDBG_COMMANDS, ['StoreStepInfo @IP=',AnAddr,' ',sym.FileName, ':',FStoreStepSrcLineNo, ' in ',sym.Name, ' @Func=',sym.Address.Address]);
|
||||||
sym.ReleaseReference;
|
sym.ReleaseReference;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
@ -896,6 +896,7 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
|||||||
FAddressInfo: PDwarfAddressInfo;
|
FAddressInfo: PDwarfAddressInfo;
|
||||||
FStateMachine: TDwarfLineInfoStateMachine;
|
FStateMachine: TDwarfLineInfoStateMachine;
|
||||||
FFrameBaseParser: TDwarfLocationExpression;
|
FFrameBaseParser: TDwarfLocationExpression;
|
||||||
|
function GetLineUnfixed: TDBGPtr;
|
||||||
function StateMachineValid: Boolean;
|
function StateMachineValid: Boolean;
|
||||||
function ReadVirtuality(out AFlags: TDbgSymbolFlags): Boolean;
|
function ReadVirtuality(out AFlags: TDbgSymbolFlags): Boolean;
|
||||||
protected
|
protected
|
||||||
@ -916,6 +917,7 @@ DECL = DW_AT_decl_column, DW_AT_decl_file, DW_AT_decl_line
|
|||||||
function CreateContext(AThreadId, AStackFrame: Integer; ADwarfInfo: TFpDwarfInfo): TFpDbgInfoContext; override;
|
function CreateContext(AThreadId, AStackFrame: Integer; ADwarfInfo: TFpDwarfInfo): TFpDbgInfoContext; override;
|
||||||
// TODO members = locals ?
|
// TODO members = locals ?
|
||||||
function GetSelfParameter(AnAddress: TDbgPtr = 0): TFpValueDwarf;
|
function GetSelfParameter(AnAddress: TDbgPtr = 0): TFpValueDwarf;
|
||||||
|
property LineUnfixed: TDBGPtr read GetLineUnfixed; // with 0 lines
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFpSymbolDwarfTypeProc }
|
{ TFpSymbolDwarfTypeProc }
|
||||||
@ -5091,12 +5093,31 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TFpSymbolDwarfDataProc.GetLine: Cardinal;
|
function TFpSymbolDwarfDataProc.GetLine: Cardinal;
|
||||||
|
var
|
||||||
|
sm: TDwarfLineInfoStateMachine;
|
||||||
begin
|
begin
|
||||||
if StateMachineValid
|
if StateMachineValid
|
||||||
then Result := FStateMachine.Line
|
then begin
|
||||||
|
Result := FStateMachine.Line;
|
||||||
|
if Result = 0 then begin // TODO: fpc specific.
|
||||||
|
sm := FStateMachine.Clone;
|
||||||
|
sm.NextLine;
|
||||||
|
Result := sm.Line;
|
||||||
|
sm.Free;
|
||||||
|
end;
|
||||||
|
end
|
||||||
else Result := inherited GetLine;
|
else Result := inherited GetLine;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFpSymbolDwarfDataProc.GetLineUnfixed: TDBGPtr;
|
||||||
|
begin
|
||||||
|
if StateMachineValid
|
||||||
|
then
|
||||||
|
Result := FStateMachine.Line
|
||||||
|
else
|
||||||
|
Result := inherited GetLine;
|
||||||
|
end;
|
||||||
|
|
||||||
function TFpSymbolDwarfDataProc.GetValueObject: TFpValue;
|
function TFpSymbolDwarfDataProc.GetValueObject: TFpValue;
|
||||||
begin
|
begin
|
||||||
assert(TypeInfo is TFpSymbolDwarfType, 'TFpSymbolDwarfDataProc.GetValueObject: TypeInfo is TFpSymbolDwarfType');
|
assert(TypeInfo is TFpSymbolDwarfType, 'TFpSymbolDwarfDataProc.GetValueObject: TypeInfo is TFpSymbolDwarfType');
|
||||||
|
Loading…
Reference in New Issue
Block a user