From b78e0db500f239ae9e3a95ddaba0a377c7b48b99 Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 28 Jun 2011 10:12:19 +0000 Subject: [PATCH] + Also look for gdb if gdbpas is not found. + AdaptToGDB procedure to convert filenames with dirtectories to the format GDB expects. git-svn-id: trunk@17853 - --- compiler/utils/gppc386.pp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/compiler/utils/gppc386.pp b/compiler/utils/gppc386.pp index fe75e7dee4..380012822d 100644 --- a/compiler/utils/gppc386.pp +++ b/compiler/utils/gppc386.pp @@ -44,12 +44,14 @@ uses const {$ifdef Unix} GDBExeName : String = 'gdbpas'; + GDBAltExeName = 'gdb'; GDBIniName = '.gdbinit'; DefaultCompilerName = 'ppc386'; PathSep=':'; DirSep = '/'; {$else} GDBExeName : String = 'gdbpas.exe'; + GDBAltExeName = 'gdb.exe'; GDBIniName = 'gdb.ini'; DefaultCompilerName = 'ppc386.exe'; PathSep=';'; @@ -62,6 +64,17 @@ const FpcGDBIniName = 'gdb.fpc'; GDBIniTempName : string = 'gdb4fpc.ini'; + +{ Dos/Windows GDB still need forward slashes } +procedure AdaptToGDB(var filename : string); +var + i : longint; +begin + for i:=1 to length(filename) do + if filename[i]='\' then + filename[i]:='/'; +end; + var fpcgdbini : text; CompilerName,Dir,Name,Ext : String; @@ -144,6 +157,11 @@ begin {$endif} GDBExeName:=fsearch(GDBExeName,Dir+PathSep+GetEnv('PATH')); + if GDBExeName='' then + GDBExeName:=fsearch(GDBAltExeName,Dir+PathSep+GetEnv('PATH')); + + AdaptToGDB(CompilerName); + AdaptToGDB(GDBIniTempName); {$ifdef EXTDEBUG} Writeln(stderr,'Starting ',GDBExeName, {$ifdef win32}