2
0
Эх сурвалжийг харах

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

git-svn-id: trunk@30572 -
pierre 10 жил өмнө
parent
commit
03ef994cc8
2 өөрчлөгдсөн 20 нэмэгдсэн , 3 устгасан
  1. 17 2
      ide/fp.pas
  2. 3 1
      ide/gdbmiproc.pas

+ 17 - 2
ide/fp.pas

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

+ 3 - 1
ide/gdbmiproc.pas

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