mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:28:19 +02:00
IDE, Debugger: Implemented symbol for pending breakpoint (used for code in libraries(dll/so), before it is loaded)
git-svn-id: trunk@57193 -
This commit is contained in:
parent
b6006da0d4
commit
c7fe5d1822
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8166,6 +8166,7 @@ images/sourceeditor/InactiveBreakPoint.png -text
|
||||
images/sourceeditor/InvalidBreakPoint.png -text
|
||||
images/sourceeditor/InvalidDisabledBreakPoint.png -text svneol=unset#image/png
|
||||
images/sourceeditor/MultiBreakPoint.png -text
|
||||
images/sourceeditor/PendingBreakPoint.png -text
|
||||
images/sourceeditor/Record.png -text
|
||||
images/sourceeditor/UnknownBreakPoint.png -text
|
||||
images/sourceeditor/UnknownDisabledBreakPoint.png -text svneol=unset#image/png
|
||||
|
@ -158,7 +158,7 @@ type
|
||||
);
|
||||
|
||||
(* TValidState: State for breakpoints *)
|
||||
TValidState = (vsUnknown, vsValid, vsInvalid);
|
||||
TValidState = (vsUnknown, vsValid, vsInvalid, vsPending);
|
||||
|
||||
const
|
||||
DebuggerDataStateStr : array[TDebuggerDataState] of string = (
|
||||
@ -352,6 +352,7 @@ type
|
||||
property Kind: TDBGBreakPointKind read GetKind write SetKind;
|
||||
property Valid: TValidState read GetValid;
|
||||
public
|
||||
procedure SetPendingToValid(const AValue: TValidState);
|
||||
procedure SetLocation(const ASource: String; const ALine: Integer); virtual;
|
||||
procedure SetWatch(const AData: String; const AScope: TDBGWatchPointScope;
|
||||
const AKind: TDBGWatchPointKind); virtual;
|
||||
@ -3520,6 +3521,12 @@ begin
|
||||
AddReference;
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.SetPendingToValid(const AValue: TValidState);
|
||||
begin
|
||||
assert(Valid = vsPending, 'Can only change state if pending');
|
||||
SetValid(AValue);
|
||||
end;
|
||||
|
||||
procedure TBaseBreakPoint.DoBreakHitCountChange;
|
||||
begin
|
||||
Changed;
|
||||
|
@ -1086,12 +1086,13 @@ type
|
||||
FAddr: TDBGPtr;
|
||||
FBreakID: Integer;
|
||||
FHitCnt: Integer;
|
||||
FValid: Boolean;
|
||||
FValid: TValidState;
|
||||
FWatchData: String;
|
||||
FWatchKind: TDBGWatchPointKind;
|
||||
FWatchScope: TDBGWatchPointScope;
|
||||
protected
|
||||
function ExecBreakInsert(out ABreakId, AHitCnt: Integer; out AnAddr: TDBGPtr): Boolean;
|
||||
function ExecBreakInsert(out ABreakId, AHitCnt: Integer; out AnAddr: TDBGPtr;
|
||||
out APending: Boolean): Boolean;
|
||||
function DoExecute: Boolean; override;
|
||||
public
|
||||
constructor Create(AOwner: TGDBMIDebugger; ASource: string; ALine: Integer;
|
||||
@ -1115,7 +1116,7 @@ type
|
||||
property Addr: TDBGPtr read FAddr;
|
||||
property BreakID: Integer read FBreakID;
|
||||
property HitCnt: Integer read FHitCnt;
|
||||
property Valid: Boolean read FValid;
|
||||
property Valid: TValidState read FValid;
|
||||
end;
|
||||
|
||||
{ TGDBMIDebuggerCommandBreakRemove }
|
||||
@ -5709,6 +5710,8 @@ function TGDBMIDebuggerCommandExecute.ProcessStopped(const AParams: String;
|
||||
if ABreakId >= 0 then
|
||||
BreakPoint := TGDBMIBreakPoint(FTheDebugger.FindBreakpoint(ABreakID));
|
||||
|
||||
if (BreakPoint <> nil) and (BreakPoint.Valid = vsPending) then
|
||||
BreakPoint.SetPendingToValid(vsValid);
|
||||
if (BreakPoint <> nil) and (BreakPoint.Kind <> bpkData) and
|
||||
(AReason in [gbrWatchScope, gbrWatchTrigger])
|
||||
then BreakPoint := nil;
|
||||
@ -7661,6 +7664,8 @@ var
|
||||
i, x: Integer;
|
||||
ct: TThreads;
|
||||
t: TThreadEntry;
|
||||
List: TGDBMINameValueList;
|
||||
BreakPoint: TGDBMIBreakPoint;
|
||||
begin
|
||||
EventText := GetPart(['='], [','], Line, False, False);
|
||||
x := StringCase(EventText, [
|
||||
@ -7711,6 +7716,19 @@ begin
|
||||
7: RemoveThreadGroup(Line);
|
||||
8: DoDbgEvent(ecThread, etThreadStart, ParseThread(Line, EventText));
|
||||
9: DoDbgEvent(ecThread, etThreadExit, ParseThread(Line, EventText));
|
||||
10: begin //breakpoint-modified
|
||||
List := TGDBMINameValueList.Create(Line);
|
||||
List.SetPath('bkpt');
|
||||
i := StrToIntDef(List.Values['number'], -1);
|
||||
BreakPoint := nil;
|
||||
if i >= 0 then
|
||||
BreakPoint := TGDBMIBreakPoint(FindBreakpoint(i));
|
||||
if (BreakPoint <> nil) and (BreakPoint.Valid = vsPending) and
|
||||
(List.IndexOf('pending') < 0) and
|
||||
(pos('pend', lowercase(List.Values['addr'])) <= 0)
|
||||
then
|
||||
BreakPoint.SetPendingToValid(vsValid);
|
||||
end;
|
||||
else
|
||||
DebugLn(DBG_WARNINGS, '[WARNING] Debugger: Unexpected async-record: ', Line);
|
||||
end;
|
||||
@ -8932,8 +8950,8 @@ end;
|
||||
|
||||
{ TGDBMIDebuggerCommandBreakInsert }
|
||||
|
||||
function TGDBMIDebuggerCommandBreakInsert.ExecBreakInsert(out ABreakId, AHitCnt: Integer; out
|
||||
AnAddr: TDBGPtr): Boolean;
|
||||
function TGDBMIDebuggerCommandBreakInsert.ExecBreakInsert(out ABreakId,
|
||||
AHitCnt: Integer; out AnAddr: TDBGPtr; out APending: Boolean): Boolean;
|
||||
var
|
||||
R: TGDBMIExecResult;
|
||||
ResultList: TGDBMINameValueList;
|
||||
@ -8944,6 +8962,7 @@ begin
|
||||
ABreakId := 0;
|
||||
AHitCnt := 0;
|
||||
AnAddr := 0;
|
||||
APending := False;
|
||||
case FKind of
|
||||
bpkSource:
|
||||
begin
|
||||
@ -9000,9 +9019,9 @@ begin
|
||||
(DebuggerProperties.WarnOnSetBreakpointError in [gdbwAll, gdbwUserBreakPoint])
|
||||
then
|
||||
Include(FTheDebugger.FDebuggerFlags, dfSetBreakFailed);
|
||||
if ((ResultList.IndexOf('pending') >= 0) or
|
||||
(pos('pend', lowercase(ResultList.Values['addr'])) > 0)) and
|
||||
(DebuggerProperties.WarnOnSetBreakpointError in [gdbwAll, gdbwUserBreakPoint])
|
||||
APending := (ResultList.IndexOf('pending') >= 0) or
|
||||
(pos('pend', lowercase(ResultList.Values['addr'])) > 0);
|
||||
if APending and (DebuggerProperties.WarnOnSetBreakpointError in [gdbwAll, gdbwUserBreakPoint])
|
||||
then
|
||||
Include(FTheDebugger.FDebuggerFlags, dfSetBreakPending);
|
||||
end;
|
||||
@ -9042,19 +9061,24 @@ begin
|
||||
end;
|
||||
|
||||
function TGDBMIDebuggerCommandBreakInsert.DoExecute: Boolean;
|
||||
var
|
||||
Pending: Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
FContext.ThreadContext := ccNotRequired;
|
||||
FContext.StackContext := ccNotRequired;
|
||||
|
||||
FValid := False;
|
||||
FValid := vsInvalid;
|
||||
DefaultTimeOut := DebuggerProperties.TimeoutForEval;
|
||||
try
|
||||
if FReplaceId <> 0
|
||||
then ExecBreakDelete(FReplaceId);
|
||||
|
||||
FValid := ExecBreakInsert(FBreakID, FHitCnt, FAddr);
|
||||
if not FValid then Exit;
|
||||
if ExecBreakInsert(FBreakID, FHitCnt, FAddr, Pending) then
|
||||
FValid := vsValid;
|
||||
if FValid = vsInvalid then Exit;
|
||||
if Pending then
|
||||
FValid := vsPending;
|
||||
|
||||
if (FExpression <> '') and not (dcsCanceled in SeenStates)
|
||||
then ExecBreakCondition(FBreakID, FExpression);
|
||||
@ -9066,7 +9090,7 @@ begin
|
||||
then begin
|
||||
ExecBreakDelete(FBreakID);
|
||||
FBreakID := 0;
|
||||
FValid := False;
|
||||
FValid := vsInvalid;
|
||||
FAddr := 0;
|
||||
FHitCnt := 0;
|
||||
end;
|
||||
@ -9417,8 +9441,9 @@ begin
|
||||
// Check Insert Result
|
||||
BeginUpdate;
|
||||
|
||||
if TGDBMIDebuggerCommandBreakInsert(Sender).Valid
|
||||
then SetValid(vsValid)
|
||||
case TGDBMIDebuggerCommandBreakInsert(Sender).Valid of
|
||||
vsValid: SetValid(vsValid);
|
||||
vsPending: SetValid(vsPending);
|
||||
else begin
|
||||
if (TGDBMIDebuggerCommandBreakInsert(Sender).Kind = bpkData) and
|
||||
(TGDBMIDebugger(Debugger).State = dsInit)
|
||||
@ -9428,6 +9453,7 @@ begin
|
||||
SetEnabled(False);
|
||||
end
|
||||
else SetValid(vsInvalid);
|
||||
end;
|
||||
end;
|
||||
|
||||
FBreakID := TGDBMIDebuggerCommandBreakInsert(Sender).BreakID;
|
||||
|
@ -201,9 +201,9 @@ function GetBreakPointStateDescription(ABreakpoint: TBaseBreakpoint): string;
|
||||
const
|
||||
// enabled valid
|
||||
DEBUG_STATE: array[Boolean, TValidState] of ShortString = (
|
||||
{vsUnknown, vsValid, vsInvalid}
|
||||
{Disabled} (lisOff, lisDisabled, lisInvalidOff),
|
||||
{Endabled} (lisOn, lisEnabled, lisInvalidOn));
|
||||
{vsUnknown, vsValid, vsInvalid, vsPending}
|
||||
{Disabled} (lisOff, lisDisabled, lisInvalidOff, lisInvalidOff),
|
||||
{Endabled} (lisOn, lisEnabled, lisInvalidOn, lisPendingOn));
|
||||
begin
|
||||
Result:=DEBUG_STATE[ABreakpoint.Enabled,ABreakpoint.Valid];
|
||||
end;
|
||||
|
@ -125,7 +125,7 @@ implementation
|
||||
var
|
||||
DBG_LOCATION_INFO: PLazLoggerLogGroup;
|
||||
BrkImgIdxInitialized: Boolean;
|
||||
ImgBreakPoints: Array [0..8] of Integer;
|
||||
ImgBreakPoints: Array [0..10] of Integer;
|
||||
|
||||
procedure CreateDebugDialog(Sender: TObject; aFormName: string; var AForm: TCustomForm;
|
||||
DoDisableAutoSizing: boolean);
|
||||
@ -408,14 +408,17 @@ begin
|
||||
ImgBreakPoints[0] := IDEImages.LoadImage('ActiveBreakPoint'); // red dot
|
||||
ImgBreakPoints[1] := IDEImages.LoadImage('InvalidBreakPoint'); // red dot "X"
|
||||
ImgBreakPoints[2] := IDEImages.LoadImage('UnknownBreakPoint'); // red dot "?"
|
||||
ImgBreakPoints[3] := IDEImages.LoadImage('PendingBreakPoint'); // red dot "||"
|
||||
|
||||
ImgBreakPoints[3] := IDEImages.LoadImage('InactiveBreakPoint');// green dot
|
||||
ImgBreakPoints[4] := IDEImages.LoadImage('InvalidDisabledBreakPoint');// green dot "X"
|
||||
ImgBreakPoints[5] := IDEImages.LoadImage('UnknownDisabledBreakPoint');// green dot "?"
|
||||
|
||||
ImgBreakPoints[6] := IDEImages.LoadImage('debugger_current_line');
|
||||
ImgBreakPoints[7] := IDEImages.LoadImage('debugger_current_line_breakpoint');
|
||||
ImgBreakPoints[8] := IDEImages.LoadImage('debugger_current_line_disabled_breakpoint');
|
||||
ImgBreakPoints[4] := IDEImages.LoadImage('InactiveBreakPoint');// green dot
|
||||
ImgBreakPoints[5] := IDEImages.LoadImage('InvalidDisabledBreakPoint');// green dot "X"
|
||||
ImgBreakPoints[6] := IDEImages.LoadImage('UnknownDisabledBreakPoint');// green dot "?"
|
||||
ImgBreakPoints[7] := IDEImages.LoadImage('InactiveBreakPoint');// green dot
|
||||
|
||||
ImgBreakPoints[8] := IDEImages.LoadImage('debugger_current_line');
|
||||
ImgBreakPoints[9] := IDEImages.LoadImage('debugger_current_line_breakpoint');
|
||||
ImgBreakPoints[10] := IDEImages.LoadImage('debugger_current_line_disabled_breakpoint');
|
||||
|
||||
BrkImgIdxInitialized := True;
|
||||
end;
|
||||
@ -423,21 +426,22 @@ begin
|
||||
if AIsCurLine
|
||||
then begin
|
||||
if ABreakPoint = nil
|
||||
then Result := ImgBreakPoints[6]
|
||||
else if ABreakPoint.Enabled
|
||||
then Result := ImgBreakPoints[7]
|
||||
else Result := ImgBreakPoints[8];
|
||||
else if ABreakPoint.Enabled
|
||||
then Result := ImgBreakPoints[9]
|
||||
else Result := ImgBreakPoints[10];
|
||||
end
|
||||
else
|
||||
if (ABreakPoint <> nil)
|
||||
then begin
|
||||
if ABreakPoint.Enabled
|
||||
then i := 0
|
||||
else i := 3;
|
||||
else i := 4;
|
||||
case ABreakPoint.Valid of
|
||||
vsValid: i := i + 0;
|
||||
vsInvalid: i := i + 1;
|
||||
vsUnknown: i := i + 2;
|
||||
vsPending: i := i + 3; // TODO
|
||||
end;
|
||||
Result := ImgBreakPoints[i];
|
||||
end;
|
||||
|
@ -514,6 +514,11 @@ begin
|
||||
Img := SourceEditorMarks.InvalidBreakPointImg
|
||||
else
|
||||
Img := SourceEditorMarks.InvalidDisabledBreakPointImg;
|
||||
vsPending:
|
||||
if Enabled then
|
||||
Img := SourceEditorMarks.PendingBreakPointImg
|
||||
else
|
||||
Img := SourceEditorMarks.InactiveBreakPointImg;
|
||||
else
|
||||
if Enabled then
|
||||
Img := SourceEditorMarks.UnknownBreakPointImg
|
||||
|
@ -5425,6 +5425,7 @@ resourcestring
|
||||
lisDisabled = 'Disabled';
|
||||
lisInvalidOff = 'Invalid (Off)';
|
||||
lisInvalidOn = 'Invalid (On)';
|
||||
lisPendingOn = 'Pending (On)';
|
||||
lisOff = '? (Off)';
|
||||
lisOn = '? (On)';
|
||||
lisTakeSnapshot = 'Take a Snapshot';
|
||||
|
@ -196,6 +196,7 @@ type
|
||||
FCurrentLineImg: Integer;
|
||||
FCurrentLineDisabledBreakPointImg: Integer;
|
||||
FExtToolsMarks: TETMarks;
|
||||
fPendingBreakPointImg: Integer;
|
||||
FSourceLineImg: Integer;
|
||||
FImgList: TImageList;
|
||||
fInactiveBreakPointImg: Integer;
|
||||
@ -242,6 +243,7 @@ type
|
||||
property InactiveBreakPointImg: Integer read fInactiveBreakPointImg;
|
||||
property InvalidBreakPointImg: Integer read fInvalidBreakPointImg;
|
||||
property InvalidDisabledBreakPointImg: Integer read fInvalidDisabledBreakPointImg;
|
||||
property PendingBreakPointImg: Integer read fPendingBreakPointImg;
|
||||
property MultiBreakPointImg: Integer read fMultiBreakPointImg;
|
||||
property UnknownBreakPointImg: Integer read fUnknownBreakPointImg;
|
||||
property UnknownDisabledBreakPointImg: Integer read fUnknownDisabledBreakPointImg;
|
||||
@ -566,6 +568,8 @@ begin
|
||||
fInvalidBreakPointImg:=AddImage('InvalidBreakPoint');
|
||||
// load invalid disabled breakpoint image
|
||||
fInvalidDisabledBreakPointImg := AddImage('InvalidDisabledBreakPoint');
|
||||
// load pending active breakpoint image
|
||||
fPendingBreakPointImg := AddImage('PendingBreakPoint');
|
||||
// load unknown breakpoint image
|
||||
fUnknownBreakPointImg:=AddImage('UnknownBreakPoint');
|
||||
// load unknown disabled breakpoint image
|
||||
|
Binary file not shown.
@ -44,3 +44,4 @@ sourceeditor/state11x11_warning.png
|
||||
sourceeditor/tsynsyncroedit.png
|
||||
sourceeditor/UnknownBreakPoint.png
|
||||
sourceeditor/UnknownDisabledBreakPoint.png
|
||||
sourceeditor/PendingBreakPoint.png
|
BIN
images/sourceeditor/PendingBreakPoint.png
Normal file
BIN
images/sourceeditor/PendingBreakPoint.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 477 B |
Loading…
Reference in New Issue
Block a user