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

View File

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