DBG: Cancel LineInfo, if unit is closed in editor

git-svn-id: trunk@37488 -
This commit is contained in:
martin 2012-06-02 19:58:36 +00:00
parent eccbedf9b1
commit e3d3ab2c54
2 changed files with 33 additions and 1 deletions

View File

@ -1501,6 +1501,7 @@ type
function GetInfo({%H-}AAdress: TDbgPtr; out {%H-}ASource, {%H-}ALine, {%H-}AOffset: Integer): Boolean; virtual; function GetInfo({%H-}AAdress: TDbgPtr; out {%H-}ASource, {%H-}ALine, {%H-}AOffset: Integer): Boolean; virtual;
function IndexOf(const {%H-}ASource: String): integer; virtual; function IndexOf(const {%H-}ASource: String): integer; virtual;
procedure Request(const {%H-}ASource: String); virtual; procedure Request(const {%H-}ASource: String); virtual;
procedure Cancel(const {%H-}ASource: String); virtual;
public public
property Sources[const AnIndex: Integer]: String read GetSource; property Sources[const AnIndex: Integer]: String read GetSource;
end; end;
@ -1535,6 +1536,7 @@ type
function GetInfo(AAdress: TDbgPtr; out ASource, ALine, AOffset: Integer): Boolean; override; function GetInfo(AAdress: TDbgPtr; out ASource, ALine, AOffset: Integer): Boolean; override;
function IndexOf(const ASource: String): integer; override; function IndexOf(const ASource: String): integer; override;
procedure Request(const ASource: String); override; procedure Request(const ASource: String); override;
procedure Cancel(const ASource: String); override;
property Master: TDBGLineInfo read FMaster write SetMaster; property Master: TDBGLineInfo read FMaster write SetMaster;
end; end;
@ -10129,6 +10131,11 @@ procedure TBaseLineInfo.Request(const ASource: String);
begin begin
end; end;
procedure TBaseLineInfo.Cancel(const ASource: String);
begin
end;
function TBaseLineInfo.Count: Integer; function TBaseLineInfo.Count: Integer;
begin begin
Result := 0; Result := 0;
@ -10247,6 +10254,13 @@ begin
else Master.Request(ASource); else Master.Request(ASource);
end; end;
procedure TIDELineInfo.Cancel(const ASource: String);
begin
if Master = nil
then inherited Cancel(ASource)
else Master.Cancel(ASource);
end;
{ TDBGLineInfo } { TDBGLineInfo }
procedure TDBGLineInfo.Changed(ASource: String); procedure TDBGLineInfo.Changed(ASource: String);

View File

@ -818,6 +818,7 @@ type
function GetInfo(AAdress: TDbgPtr; out ASource, ALine, AOffset: Integer): Boolean; override; function GetInfo(AAdress: TDbgPtr; out ASource, ALine, AOffset: Integer): Boolean; override;
function IndexOf(const ASource: String): integer; override; function IndexOf(const ASource: String): integer; override;
procedure Request(const ASource: String); override; procedure Request(const ASource: String); override;
procedure Cancel(const ASource: String); override;
end; end;
{%endregion ^^^^^ LineSymbolInfo ^^^^^ } {%endregion ^^^^^ LineSymbolInfo ^^^^^ }
@ -5483,7 +5484,7 @@ begin
Result := True; Result := True;
ExecuteCommand('-symbol-list-lines %s', [FSource], FResult); ExecuteCommand('-symbol-list-lines %s', [FSource], FResult);
if FResult.State = dsError if (FResult.State = dsError) and not(dcsCanceled in SeenStates)
then begin then begin
// the second trial: gdb can return info to file w/o path // the second trial: gdb can return info to file w/o path
Src := ExtractFileName(FSource); Src := ExtractFileName(FSource);
@ -6008,6 +6009,23 @@ begin
(* DoEvaluationFinished may be called immediately at this point *) (* DoEvaluationFinished may be called immediately at this point *)
end; end;
procedure TGDBMILineInfo.Cancel(const ASource: String);
var
i: Integer;
q: TGDBMIDebugger;
begin
q := TGDBMIDebugger(Debugger);
i := q.FCommandQueue.Count - 1;
while i >= 0 do begin
if (q.FCommandQueue[i] is TGDBMIDebuggerCommandLineSymbolInfo) and
(TGDBMIDebuggerCommandLineSymbolInfo(q.FCommandQueue[i]).Source = ASource)
then q.FCommandQueue[i].Cancel;
dec(i);
if i >= q.FCommandQueue.Count
then i := q.FCommandQueue.Count - 1;
end;
end;
{ =========================================================================== } { =========================================================================== }
{ TGDBMIDebuggerProperties } { TGDBMIDebuggerProperties }