FpDebug: debugln

git-svn-id: trunk@62406 -
This commit is contained in:
martin 2019-12-16 23:22:53 +00:00
parent 4640c96ffc
commit 98aa637a42
6 changed files with 25 additions and 26 deletions

View File

@ -1507,7 +1507,6 @@ begin
while (not Result) and (sz > 1) do begin
sz := sz div 2;
Result := ReadData(AAdress, sz, (@AData + Offs)^);
debugln(['>>>>>>>>> PART READ MEM ', Offs, ' : ', sz, ' ',Result, ' ', APartSize]);
end;
if not Result then
break;
@ -2160,7 +2159,6 @@ begin
Result := ( (FPausedAtRemovedBreakPointState = rbFound) and
(FPausedAtRemovedBreakPointAddress = t) ) or
( (t <> 0) and Process.HasInsertedBreakInstructionAtLocation(t - 1) );
debugln(['####### CHECK ',result, ' for id ', ID, ' stored ', FPausedAtRemovedBreakPointState=rbFound, ' ',FPausedAtRemovedBreakPointAddress=t, ' ',dbghex(t), ' ', dbghex(FPausedAtRemovedBreakPointAddress)]);
end;
procedure TDbgThread.CheckAndResetInstructionPointerAfterBreakpoint;

View File

@ -1268,9 +1268,7 @@ begin
// TODO: only valid, as long as context is valid, because if context is freed, then self is lost too
ADbgValue := SelfParam.MemberByName[AName];
assert(ADbgValue <> nil, 'FindSymbol: SelfParam.MemberByName[AName]');
end
else debugln(['TDbgDwarfInfoAddressContext.FindSymbol XXXXXXXXXXXXX no self']);
;
end;
if ADbgValue = nil then begin // Todo: abort the searh /SetError
ADbgValue := SymbolToValue(TFpSymbolDwarf.CreateSubClass(AName, InfoEntry));
end;
@ -3308,13 +3306,13 @@ begin
// DW_AT_data_member_location in members [ block or const]
// DW_AT_location [block or reference] todo: const
if not InformationEntry.ReadValue(AnAttribData, Val) then begin
DebugLn(['LocationFromAttrData: failed to read DW_AT_location']);
DebugLn([FPDBG_DWARF_VERBOSE, 'LocationFromAttrData: failed to read DW_AT_location']);
SetLastError(AValueObj, CreateError(fpErrAnyError));
exit;
end;
if Length(Val) = 0 then begin
DebugLn('LocationFromAttrData: Warning DW_AT_location empty');
DebugLn(FPDBG_DWARF_VERBOSE, 'LocationFromAttrData: Warning DW_AT_location empty');
SetLastError(AValueObj, CreateError(fpErrAnyError));
//exit;
end;
@ -3331,7 +3329,7 @@ begin
Result := IsValidLoc(AnAddress);
if IsTargetAddr(AnAddress) and AnAdjustAddress then
AnAddress.Address :=CompilationUnit.MapAddressToNewValue(AnAddress.Address);
debugln(not Result, ['TDbgDwarfIdentifier.LocationFromAttrDataFAILED']); // TODO
debugln(FPDBG_DWARF_VERBOSE and (not Result), ['TDbgDwarfIdentifier.LocationFromAttrDataFAILED']); // TODO
LocationParser.Free;
end;
@ -3359,7 +3357,7 @@ begin
if not Result then
AnAddress := InvalidLoc;
if not Result then
DebugLn(['LocationFromTag: failed to read DW_AT_..._location / ASucessOnMissingTag=', dbgs(ASucessOnMissingTag)]);
DebugLn([FPDBG_DWARF_VERBOSE, 'LocationFromTag: failed to read DW_AT_..._location / ASucessOnMissingTag=', dbgs(ASucessOnMissingTag)]);
exit;
end;
@ -4613,8 +4611,8 @@ end;
function TFpSymbolDwarfDataMember.GetValueAddress(AValueObj: TFpValueDwarf; out
AnAddress: TFpDbgMemLocation): Boolean;
begin
if AValueObj = nil then debugln(['TFpSymbolDwarfDataMember.InitLocationParser: NO VAl Obj !!!!!!!!!!!!!!!'])
else if AValueObj.StructureValue = nil then debugln(['TFpSymbolDwarfDataMember.InitLocationParser: NO STRUCT Obj !!!!!!!!!!!!!!!']);
if AValueObj = nil then debugln([FPDBG_DWARF_VERBOSE, 'TFpSymbolDwarfDataMember.InitLocationParser: NO VAl Obj !!!!!!!!!!!!!!!'])
else if AValueObj.StructureValue = nil then debugln(FPDBG_DWARF_VERBOSE, ['TFpSymbolDwarfDataMember.InitLocationParser: NO STRUCT Obj !!!!!!!!!!!!!!!']);
if (AValueObj = nil) or (AValueObj.StructureValue = nil) or (AValueObj.FParentTypeSymbol = nil)
then begin
@ -5035,13 +5033,11 @@ procedure TFpSymbolDwarfTypeArray.ResetValueBounds;
var
i: Integer;
begin
debuglnEnter(['TFpSymbolDwarfTypeArray.ResetValueBounds ' , Self.ClassName, dbgs(self)]); try
inherited ResetValueBounds;
if FMembers <> nil then
for i := 0 to FMembers.Count - 1 do
if TObject(FMembers[i]) is TFpSymbolDwarfType then
TFpSymbolDwarfType(FMembers[i]).ResetValueBounds;
finally debuglnExit(['TFpSymbolDwarfTypeArray.ResetValueBounds ' ]); end;
end;
{ TDbgDwarfSymbol }

View File

@ -215,6 +215,9 @@ type
implementation
var
FPDBG_DWARF_VERBOSE: PLazLoggerLogGroup;
{ TFpDwarfFreePascalSymbolClassMap }
function TFpDwarfFreePascalSymbolClassMap.CanHandleCompUnit(
@ -455,7 +458,7 @@ begin
ParentFpVal := ParentFpSym.Value;
ApplyContext(ParentFpVal);
if not (svfOrdinal in ParentFpVal.FieldFlags) then begin
DebugLn('no ordinal for parentfp');
DebugLn(FPDBG_DWARF_VERBOSE, 'no ordinal for parentfp');
ParentFpSym.ReleaseReference;
ParentFpVal.ReleaseReference;
FOuterNotFound := True;
@ -465,9 +468,8 @@ begin
par_fp := ParentFpVal.AsCardinal;
ParentFpVal.ReleaseReference;
ParentFpSym.ReleaseReference;
DebugLn(['par_fp=',par_fp]);
if par_fp = 0 then begin
DebugLn('no ordinal for parentfp');
DebugLn(FPDBG_DWARF_VERBOSE, 'no ordinal for parentfp');
FOuterNotFound := True;
exit;
end;
@ -1188,5 +1190,7 @@ initialization
DwarfSymbolClassMapList.AddMap(TFpDwarfFreePascalSymbolClassMapDwarf2);
DwarfSymbolClassMapList.AddMap(TFpDwarfFreePascalSymbolClassMapDwarf3);
FPDBG_DWARF_VERBOSE := DebugLogger.FindOrRegisterLogGroup('FPDBG_DWARF_VERBOSE' {$IFDEF FPDBG_DWARF_VERBOSE} , True {$ENDIF} );
end.

View File

@ -102,7 +102,7 @@
unit FpDbgWinClasses;
{$mode objfpc}{$H+}
{$DEFINE DebuglnWinDebugEvents}
{off $DEFINE DebuglnWinDebugEvents}
interface
@ -1512,7 +1512,7 @@ begin
Dr2 := DWORD(TFpIntelWatchPointData(AWatchPointData).Dr03[2]);
Dr3 := DWORD(TFpIntelWatchPointData(AWatchPointData).Dr03[3]);
Dr7 := (Dr7 and $0000FF00) or DWORD(TFpIntelWatchPointData(AWatchPointData).Dr7);
DebugLn('### WATCH ADDED dr0 %x dr1 %x dr2 %x dr3 %x dr7 %x', [ dr0,dr1,dr2,dr3, dr7]);
DebugLn(DBG_VERBOSE, '### WATCH ADDED dr0 %x dr1 %x dr2 %x dr3 %x dr7 %x', [ dr0,dr1,dr2,dr3, dr7]);
end;
end
else begin
@ -1523,7 +1523,7 @@ DebugLn('### WATCH ADDED dr0 %x dr1 %x dr2 %x dr3 %x dr7 %x', [ dr0,dr1
Dr2 := TFpIntelWatchPointData(AWatchPointData).Dr03[2];
Dr3 := TFpIntelWatchPointData(AWatchPointData).Dr03[3];
Dr7 := (Dr7 and $0000FF00) or TFpIntelWatchPointData(AWatchPointData).Dr7;
DebugLn('### WATCH ADDED dr0 %x dr1 %x dr2 %x dr3 %x dr7 %x', [ dr0,dr1,dr2,dr3, dr7]);
DebugLn(DBG_VERBOSE, '### WATCH ADDED dr0 %x dr1 %x dr2 %x dr3 %x dr7 %x', [ dr0,dr1,dr2,dr3, dr7]);
end;
{$ifdef cpux86_64}
end;

View File

@ -418,7 +418,7 @@ function dbgs(const AReadDataType: TFpDbgMemReadDataType): String; overload;
implementation
var
DBG_VERBOSE: PLazLoggerLogGroup;
FPDBG_VERBOSE_MEM: PLazLoggerLogGroup;
function NilLoc: TFpDbgMemLocation;
begin
@ -1125,7 +1125,7 @@ var
SourceReadSize, SourceFullSize: QWord;
begin
Result := False;
DebugLn(DBG_VERBOSE, ['$ReadMem: ', dbgs(AReadDataType),' ', dbgs(ASourceLocation), ' ', dbgs(ASourceSize), ' Dest ', ADestSize]);
DebugLn(FPDBG_VERBOSE_MEM, ['$ReadMem: ', dbgs(AReadDataType),' ', dbgs(ASourceLocation), ' ', dbgs(ASourceSize), ' Dest ', ADestSize]);
if (ASourceLocation.MType in [mlfInvalid, mlfUninitialized]) or
(ASourceSize <= 0)
then begin
@ -1460,6 +1460,6 @@ begin
end;
initialization
DBG_VERBOSE := DebugLogger.FindOrRegisterLogGroup('DBG_VERBOSE' {$IFDEF DBG_VERBOSE} , True {$ENDIF} );
FPDBG_VERBOSE_MEM := DebugLogger.FindOrRegisterLogGroup('FPDBG_VERBOSE_MEM' {$IFDEF FPDBG_VERBOSE_MEM} , True {$ENDIF} );
end.

View File

@ -458,7 +458,7 @@ uses
FpDbgDisasX86;
var
DBG_BREAKPOINTS, FPDBG_COMMANDS: PLazLoggerLogGroup;
DBG_VERBOSE, DBG_BREAKPOINTS, FPDBG_COMMANDS: PLazLoggerLogGroup;
type
@ -2793,7 +2793,7 @@ end;
procedure TFpDebugDebugger.StartDebugLoop;
begin
{$ifdef DBG_FPDEBUG_VERBOSE}
DebugLn('StartDebugLoop');
DebugLn(DBG_VERBOSE, 'StartDebugLoop');
{$endif DBG_FPDEBUG_VERBOSE}
RTLeventSetEvent(FFpDebugThread.StartDebugLoopEvent);
end;
@ -2805,7 +2805,7 @@ begin
LockRelease;
try
{$ifdef DBG_FPDEBUG_VERBOSE}
DebugLn('DebugLoopFinished');
DebugLn(DBG_VERBOSE, 'DebugLoopFinished');
{$endif DBG_FPDEBUG_VERBOSE}
(* Need to ensure CurrentThreadId is correct,
@ -2838,7 +2838,7 @@ end;
procedure TFpDebugDebugger.DoRelease;
begin
DebugLn(['++++ dorelase ', Dbgs(ptrint(FDbgController)), dbgs(state)]);
DebugLn(DBG_VERBOSE, ['++++ dorelase ', Dbgs(ptrint(FDbgController)), dbgs(state)]);
// SetState(dsDestroying);
if (State <> dsDestroying) and //assigned(FFpDebugThread) and //???
(FDbgController <> nil) and (FDbgController.MainProcess <> nil)
@ -3225,6 +3225,7 @@ begin
end;
initialization
DBG_VERBOSE := DebugLogger.FindOrRegisterLogGroup('DBG_VERBOSE' {$IFDEF DBG_VERBOSE} , True {$ENDIF} );
DBG_BREAKPOINTS := DebugLogger.FindOrRegisterLogGroup('DBG_BREAKPOINTS' {$IFDEF DBG_BREAKPOINTS} , True {$ENDIF} );
FPDBG_COMMANDS := DebugLogger.FindOrRegisterLogGroup('FPDBG_COMMANDS' {$IFDEF FPDBG_COMMANDS} , True {$ENDIF} );