|
@@ -67,8 +67,8 @@ type
|
|
{ set command }
|
|
{ set command }
|
|
function SetCommand(Const SetExpr : string) : boolean;
|
|
function SetCommand(Const SetExpr : string) : boolean;
|
|
{ print }
|
|
{ print }
|
|
- function PrintCommand(const expr : string): pchar;
|
|
|
|
- function PrintFormattedCommand(const expr : string; Format : TPrintFormatType): pchar;
|
|
|
|
|
|
+ function PrintCommand(const expr : string): AnsiString;
|
|
|
|
+ function PrintFormattedCommand(const expr : string; Format : TPrintFormatType): AnsiString;
|
|
{ breakpoints }
|
|
{ breakpoints }
|
|
function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
|
|
function BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
|
|
function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
|
|
function WatchpointInsert(const location: string; WatchpointType: TWatchpointType): LongInt;
|
|
@@ -109,6 +109,17 @@ begin
|
|
{$endif windows}
|
|
{$endif windows}
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function AnsiStrPas(S: PChar): AnsiString;
|
|
|
|
+var
|
|
|
|
+ Res: AnsiString;
|
|
|
|
+ Len: LongInt;
|
|
|
|
+begin
|
|
|
|
+ Len := StrLen(S);
|
|
|
|
+ SetLength(Res, Len);
|
|
|
|
+ Move(S, Res[1], Len);
|
|
|
|
+ AnsiStrPas := Res;
|
|
|
|
+end;
|
|
|
|
+
|
|
constructor TGDBController.Init;
|
|
constructor TGDBController.Init;
|
|
begin
|
|
begin
|
|
inherited Init;
|
|
inherited Init;
|
|
@@ -300,26 +311,26 @@ end;
|
|
|
|
|
|
|
|
|
|
{ print }
|
|
{ print }
|
|
-function TGDBController.PrintCommand(const expr : string): pchar;
|
|
|
|
|
|
+function TGDBController.PrintCommand(const expr : string): AnsiString;
|
|
begin
|
|
begin
|
|
Command('-data-evaluate-expression '+expr);
|
|
Command('-data-evaluate-expression '+expr);
|
|
if GDB.ResultRecord.Success then
|
|
if GDB.ResultRecord.Success then
|
|
- PrintCommand:=strnew(pchar(GDB.ResultRecord.Parameters['value'].AsString))
|
|
|
|
|
|
+ PrintCommand:=GDB.ResultRecord.Parameters['value'].AsString
|
|
else
|
|
else
|
|
- PrintCommand:=strnew(GetError);
|
|
|
|
|
|
+ PrintCommand:=AnsiStrPas(GetError);
|
|
end;
|
|
end;
|
|
|
|
|
|
const
|
|
const
|
|
PrintFormatName : Array[TPrintFormatType] of string[11] =
|
|
PrintFormatName : Array[TPrintFormatType] of string[11] =
|
|
('binary', 'decimal', 'hexadecimal', 'octal', 'natural');
|
|
('binary', 'decimal', 'hexadecimal', 'octal', 'natural');
|
|
|
|
|
|
-function TGDBController.PrintFormattedCommand(const expr : string; Format : TPrintFormatType): pchar;
|
|
|
|
|
|
+function TGDBController.PrintFormattedCommand(const expr : string; Format : TPrintFormatType): ansistring;
|
|
begin
|
|
begin
|
|
Command('-var-evaluate-expression -f '+PrintFormatName[Format]+' '+expr);
|
|
Command('-var-evaluate-expression -f '+PrintFormatName[Format]+' '+expr);
|
|
if GDB.ResultRecord.Success then
|
|
if GDB.ResultRecord.Success then
|
|
- PrintFormattedCommand:=strnew(pchar(GDB.ResultRecord.Parameters['value'].AsString))
|
|
|
|
|
|
+ PrintFormattedCommand:=GDB.ResultRecord.Parameters['value'].AsString
|
|
else
|
|
else
|
|
- PrintFormattedCommand:=strnew(GetError);
|
|
|
|
|
|
+ PrintFormattedCommand:=AnsiStrPas(GetError);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TGDBController.BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
|
|
function TGDBController.BreakpointInsert(const location: string; BreakpointFlags: TBreakpointFlags): LongInt;
|