Add -G command line option to allow specification of GDB executable name

git-svn-id: trunk@30572 -
This commit is contained in:
pierre 2015-04-13 16:39:27 +00:00
parent 1c067b755c
commit 03ef994cc8
2 changed files with 20 additions and 3 deletions

View File

@ -83,6 +83,9 @@ uses
FPTools,
{$ifndef NODEBUG}
FPDebug,FPRegs,
{$ifdef GDBMI}
gdbmiproc,
{$endif GDBMI}
{$endif}
FPTemplt,FPRedir,FPDesk,
FPCodTmp,FPCodCmp,
@ -200,6 +203,16 @@ begin
Delete(Param,1,1); { eat optional separator }
IniFileName:=Param;
end;
{$ifdef GDBMI}
'G' : { custom GDB exec file (GDBMI mode only) }
if BeforeINI then
begin
delete(param,1,1); // delete C
if (length(Param)>=1) and (Param[1] in['=',':']) then
Delete(Param,1,1); { eat optional separator }
GDBProgramName:=Param;
end;
{$endif def GDBMI}
'R' : { enter the directory last exited from (BP comp.) }
begin
Param:=copy(Param,2,255);
@ -363,6 +376,10 @@ BEGIN
{ Startup info }
writeln(bullet+' Free Pascal IDE Version '+VersionStr+' ['+{$i %date%}+']');
writeln(bullet+' Compiler Version '+Full_Version_String);
{ Process params before printing GDB version because of /G option }
ProcessParams(true);
{$ifndef NODEBUG}
writeln(bullet+' GDB Version '+GDBVersion);
{$ifdef Windows}
@ -379,8 +396,6 @@ BEGIN
{$endif Windows}
{$endif NODEBUG}
ProcessParams(true);
{$ifdef DEBUG}
StartTime:=getrealtime;
{$endif DEBUG}

View File

@ -42,11 +42,13 @@ type
property Alive: Boolean read IsAlive;
end;
var
GdbProgramName: string = 'gdb';
implementation
var
DebugLogEnabled: Boolean = False;
GdbProgramName: string = 'gdb';
function TGDBProcess.IsAlive: Boolean;
begin