mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:59:19 +02:00
Debugger: Fixed integer types to prevent a range check error. Issue #20691
git-svn-id: trunk@33558 -
This commit is contained in:
parent
1b15a816ff
commit
3a71f62ad3
@ -54,7 +54,7 @@ type
|
|||||||
FFlushAfterRead: Boolean;// Set if we should flush after finished reading
|
FFlushAfterRead: Boolean;// Set if we should flush after finished reading
|
||||||
FPeekOffset: Integer; // Count the number of lines we have peeked
|
FPeekOffset: Integer; // Count the number of lines we have peeked
|
||||||
FReadLineTimedOut: Boolean;
|
FReadLineTimedOut: Boolean;
|
||||||
function WaitForHandles(const AHandles: array of Integer; var ATimeOut: Integer): Integer; overload;
|
function WaitForHandles(const AHandles: array of Integer; var ATimeOut: Int64): Integer; overload;
|
||||||
function WaitForHandles(const AHandles: array of Integer): Integer; overload;
|
function WaitForHandles(const AHandles: array of Integer): Integer; overload;
|
||||||
protected
|
protected
|
||||||
procedure DoReadError; virtual;
|
procedure DoReadError; virtual;
|
||||||
@ -64,8 +64,8 @@ type
|
|||||||
function CreateDebugProcess(const AOptions: String): Boolean; virtual;
|
function CreateDebugProcess(const AOptions: String): Boolean; virtual;
|
||||||
procedure Flush; // Flushes output buffer
|
procedure Flush; // Flushes output buffer
|
||||||
function GetWaiting: Boolean; override;
|
function GetWaiting: Boolean; override;
|
||||||
function ReadLine(ATimeOut: Integer = -1): String; overload;
|
function ReadLine(ATimeOut: Int64 = -1): String; overload;
|
||||||
function ReadLine(const APeek: Boolean; ATimeOut: Integer = -1): String; virtual; overload;
|
function ReadLine(const APeek: Boolean; ATimeOut: Int64 = -1): String; virtual; overload;
|
||||||
procedure SendCmdLn(const ACommand: String); virtual; overload;
|
procedure SendCmdLn(const ACommand: String); virtual; overload;
|
||||||
procedure SendCmdLn(const ACommand: String; Values: array of const); overload;
|
procedure SendCmdLn(const ACommand: String; Values: array of const); overload;
|
||||||
procedure SetLineEnds(ALineEnds: TStringDynArray);
|
procedure SetLineEnds(ALineEnds: TStringDynArray);
|
||||||
@ -103,14 +103,14 @@ uses
|
|||||||
TimeOut: Max Time in milli-secs => set to 0 if timeout occured
|
TimeOut: Max Time in milli-secs => set to 0 if timeout occured
|
||||||
Returns: BitArray of handles set, 0 when an error occoured
|
Returns: BitArray of handles set, 0 when an error occoured
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TCmdLineDebugger.WaitForHandles(const AHandles: array of Integer; var ATimeOut: Integer): Integer;
|
function TCmdLineDebugger.WaitForHandles(const AHandles: array of Integer; var ATimeOut: Int64): Integer;
|
||||||
{$IFDEF UNIX}
|
{$IFDEF UNIX}
|
||||||
var
|
var
|
||||||
n, R, Max, Count: Integer;
|
n, R, Max, Count: Integer;
|
||||||
TimeOut: Integer;
|
TimeOut: Integer;
|
||||||
FDSWait, FDS: TFDSet;
|
FDSWait, FDS: TFDSet;
|
||||||
Step: Integer;
|
Step: Integer;
|
||||||
t, t2, t3: DWord;
|
t, t2, t3: Int64;
|
||||||
begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
Max := 0;
|
Max := 0;
|
||||||
@ -268,7 +268,7 @@ end;
|
|||||||
|
|
||||||
function TCmdLineDebugger.WaitForHandles(const AHandles: array of Integer): Integer; overload;
|
function TCmdLineDebugger.WaitForHandles(const AHandles: array of Integer): Integer; overload;
|
||||||
var
|
var
|
||||||
t: Integer;
|
t: Int64;
|
||||||
begin
|
begin
|
||||||
t := -1;
|
t := -1;
|
||||||
Result := WaitForHandles(AHandles, t);
|
Result := WaitForHandles(AHandles, t);
|
||||||
@ -355,12 +355,12 @@ begin
|
|||||||
Result := FReading;
|
Result := FReading;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCmdLineDebugger.ReadLine(ATimeOut: Integer = -1): String;
|
function TCmdLineDebugger.ReadLine(ATimeOut: Int64 = -1): String;
|
||||||
begin
|
begin
|
||||||
Result := ReadLine(False, ATimeOut);
|
Result := ReadLine(False, ATimeOut);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCmdLineDebugger.ReadLine(const APeek: Boolean; ATimeOut: Integer = -1): String;
|
function TCmdLineDebugger.ReadLine(const APeek: Boolean; ATimeOut: Int64 = -1): String;
|
||||||
|
|
||||||
function ReadData(const AStream: TStream; var ABuffer: String): Integer;
|
function ReadData(const AStream: TStream; var ABuffer: String): Integer;
|
||||||
var
|
var
|
||||||
|
@ -224,24 +224,24 @@ type
|
|||||||
// ExecuteCommand does execute direct. It does not use the queue
|
// ExecuteCommand does execute direct. It does not use the queue
|
||||||
function ExecuteCommand(const ACommand: String;
|
function ExecuteCommand(const ACommand: String;
|
||||||
AFlags: TGDBMICommandFlags = [];
|
AFlags: TGDBMICommandFlags = [];
|
||||||
ATimeOut: Integer = -1
|
ATimeOut: Int64 = -1
|
||||||
): Boolean; overload;
|
): Boolean; overload;
|
||||||
function ExecuteCommand(const ACommand: String;
|
function ExecuteCommand(const ACommand: String;
|
||||||
out AResult: TGDBMIExecResult;
|
out AResult: TGDBMIExecResult;
|
||||||
AFlags: TGDBMICommandFlags = [];
|
AFlags: TGDBMICommandFlags = [];
|
||||||
ATimeOut: Integer = -1
|
ATimeOut: Int64 = -1
|
||||||
): Boolean; overload;
|
): Boolean; overload;
|
||||||
function ExecuteCommand(const ACommand: String; const AValues: array of const;
|
function ExecuteCommand(const ACommand: String; const AValues: array of const;
|
||||||
AFlags: TGDBMICommandFlags;
|
AFlags: TGDBMICommandFlags;
|
||||||
ATimeOut: Integer = -1
|
ATimeOut: Int64 = -1
|
||||||
): Boolean; overload;
|
): Boolean; overload;
|
||||||
function ExecuteCommand(const ACommand: String; const AValues: array of const;
|
function ExecuteCommand(const ACommand: String; const AValues: array of const;
|
||||||
out AResult: TGDBMIExecResult;
|
out AResult: TGDBMIExecResult;
|
||||||
AFlags: TGDBMICommandFlags = [];
|
AFlags: TGDBMICommandFlags = [];
|
||||||
ATimeOut: Integer = -1
|
ATimeOut: Int64 = -1
|
||||||
): Boolean; overload;
|
): Boolean; overload;
|
||||||
procedure DoTimeoutFeedback;
|
procedure DoTimeoutFeedback;
|
||||||
function ProcessResult(var AResult: TGDBMIExecResult; ATimeOut: Integer = -1): Boolean;
|
function ProcessResult(var AResult: TGDBMIExecResult; ATimeOut: Int64 = -1): Boolean;
|
||||||
function ProcessGDBResultText(S: String): String;
|
function ProcessGDBResultText(S: String): String;
|
||||||
function GetStackDepth(MaxDepth: integer): Integer;
|
function GetStackDepth(MaxDepth: integer): Integer;
|
||||||
function FindStackFrame(FP: TDBGPtr; StartAt, MaxDepth: Integer): Integer;
|
function FindStackFrame(FP: TDBGPtr; StartAt, MaxDepth: Integer): Integer;
|
||||||
@ -9651,7 +9651,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
||||||
AFlags: TGDBMICommandFlags = []; ATimeOut: Integer = -1): Boolean;
|
AFlags: TGDBMICommandFlags = []; ATimeOut: Int64 = -1): Boolean;
|
||||||
var
|
var
|
||||||
R: TGDBMIExecResult;
|
R: TGDBMIExecResult;
|
||||||
begin
|
begin
|
||||||
@ -9660,7 +9660,7 @@ end;
|
|||||||
|
|
||||||
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
||||||
out AResult: TGDBMIExecResult; AFlags: TGDBMICommandFlags = [];
|
out AResult: TGDBMIExecResult; AFlags: TGDBMICommandFlags = [];
|
||||||
ATimeOut: Integer = -1): Boolean;
|
ATimeOut: Int64 = -1): Boolean;
|
||||||
|
|
||||||
function RevorerTimeOut: Boolean;
|
function RevorerTimeOut: Boolean;
|
||||||
var
|
var
|
||||||
@ -9769,7 +9769,7 @@ end;
|
|||||||
|
|
||||||
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
||||||
const AValues: array of const; AFlags: TGDBMICommandFlags;
|
const AValues: array of const; AFlags: TGDBMICommandFlags;
|
||||||
ATimeOut: Integer = -1): Boolean;
|
ATimeOut: Int64 = -1): Boolean;
|
||||||
var
|
var
|
||||||
R: TGDBMIExecResult;
|
R: TGDBMIExecResult;
|
||||||
begin
|
begin
|
||||||
@ -9778,7 +9778,7 @@ end;
|
|||||||
|
|
||||||
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
function TGDBMIDebuggerCommand.ExecuteCommand(const ACommand: String;
|
||||||
const AValues: array of const; out AResult: TGDBMIExecResult;
|
const AValues: array of const; out AResult: TGDBMIExecResult;
|
||||||
AFlags: TGDBMICommandFlags = []; ATimeOut: Integer = -1): Boolean;
|
AFlags: TGDBMICommandFlags = []; ATimeOut: Int64 = -1): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := ExecuteCommand(Format(ACommand, AValues), AResult, AFlags, ATimeOut);
|
Result := ExecuteCommand(Format(ACommand, AValues), AResult, AFlags, ATimeOut);
|
||||||
end;
|
end;
|
||||||
@ -9790,7 +9790,7 @@ begin
|
|||||||
mtWarning, [mbOK], 0);
|
mtWarning, [mbOK], 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TGDBMIDebuggerCommand.ProcessResult(var AResult: TGDBMIExecResult;ATimeOut: Integer = -1): Boolean;
|
function TGDBMIDebuggerCommand.ProcessResult(var AResult: TGDBMIExecResult;ATimeOut: Int64 = -1): Boolean;
|
||||||
var
|
var
|
||||||
InLogWarning: Boolean;
|
InLogWarning: Boolean;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ type
|
|||||||
protected
|
protected
|
||||||
FTestCmdLine: String;
|
FTestCmdLine: String;
|
||||||
procedure SendCmdLn(const ACommand: String); override; overload;
|
procedure SendCmdLn(const ACommand: String); override; overload;
|
||||||
function ReadLine(const APeek: Boolean; ATimeOut: Integer = - 1): String; override; overload;
|
function ReadLine(const APeek: Boolean; ATimeOut: Int64 = - 1): String; override; overload;
|
||||||
function CreateDebugProcess(const AOptions: String): Boolean; override;
|
function CreateDebugProcess(const AOptions: String): Boolean; override;
|
||||||
function GetDebugProcessRunning: Boolean; override;
|
function GetDebugProcessRunning: Boolean; override;
|
||||||
protected
|
protected
|
||||||
@ -67,7 +67,7 @@ begin
|
|||||||
FTestCmdLine := ACommand;
|
FTestCmdLine := ACommand;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TTestBrkGDBMIDebugger.ReadLine(const APeek: Boolean; ATimeOut: Integer): String;
|
function TTestBrkGDBMIDebugger.ReadLine(const APeek: Boolean; ATimeOut: Int64): String;
|
||||||
procedure SkipSpaces(var pos: Integer);
|
procedure SkipSpaces(var pos: Integer);
|
||||||
begin
|
begin
|
||||||
while (pos <= length(FTestCmdLine)) and (FTestCmdLine[pos] = ' ') do inc(pos);
|
while (pos <= length(FTestCmdLine)) and (FTestCmdLine[pos] = ' ') do inc(pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user