Browse Source

--- Merging r14034 into '.':
U packages/gdbint/Makefile.fpc
U packages/gdbint/Makefile
--- Merging r14035 into '.':
G packages/gdbint/Makefile.fpc
G packages/gdbint/Makefile
--- Merging r14036 into '.':
U packages/gdbint/src/gdbint.pp
--- Merging r14047 into '.':
U ide/fpdebug.pas
--- Merging r14061 into '.':
U ide/Makefile
U ide/globdir.inc
U ide/Makefile.fpc
--- Merging r14062 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14070 into '.':
G packages/gdbint/src/gdbint.pp
--- Merging r14071 into '.':
G packages/gdbint/Makefile.fpc
G packages/gdbint/Makefile
--- Merging r14072 into '.':
G packages/gdbint/src/gdbint.pp

# revisions: 14034,14035,14036,14047,14061,14062,14070,14071,14072
------------------------------------------------------------------------
r14034 | pierre | 2009-11-04 01:28:57 +0100 (Wed, 04 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/Makefile
M /trunk/packages/gdbint/Makefile.fpc

* use -dUSE_MINGW_GDB for gdbcon unit also
------------------------------------------------------------------------
------------------------------------------------------------------------
r14035 | pierre | 2009-11-04 01:31:20 +0100 (Wed, 04 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/Makefile
M /trunk/packages/gdbint/Makefile.fpc

* add missing directory for gdbcon.pp source
------------------------------------------------------------------------
------------------------------------------------------------------------
r14036 | pierre | 2009-11-04 01:47:25 +0100 (Wed, 04 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* add new fields to symtab_and_line record
------------------------------------------------------------------------
------------------------------------------------------------------------
r14047 | pierre | 2009-11-04 15:21:32 +0100 (Wed, 04 Nov 2009) | 1 line
Changed paths:
M /trunk/ide/fpdebug.pas

* more GDB 7.0 changes
------------------------------------------------------------------------
------------------------------------------------------------------------
r14061 | pierre | 2009-11-05 00:30:49 +0100 (Thu, 05 Nov 2009) | 1 line
Changed paths:
M /trunk/ide/Makefile
M /trunk/ide/Makefile.fpc
M /trunk/ide/globdir.inc

+ Add support for gdblib.inc in libgdb directory
------------------------------------------------------------------------
------------------------------------------------------------------------
r14062 | pierre | 2009-11-05 00:32:12 +0100 (Thu, 05 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

+ Define COMPILING_GDBINT_UNIT before including gdblib.inc file
------------------------------------------------------------------------
------------------------------------------------------------------------
r14070 | pierre | 2009-11-05 23:51:28 +0100 (Thu, 05 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* Try to fix the target_kill linking error
------------------------------------------------------------------------
------------------------------------------------------------------------
r14071 | pierre | 2009-11-05 23:52:29 +0100 (Thu, 05 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/Makefile
M /trunk/packages/gdbint/Makefile.fpc

* be sure to delete src/gdbver.inc after use for cross compilation
------------------------------------------------------------------------
------------------------------------------------------------------------
r14072 | pierre | 2009-11-06 00:48:59 +0100 (Fri, 06 Nov 2009) | 1 line
Changed paths:
M /trunk/packages/gdbint/src/gdbint.pp

* fix some conditional ordering
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@14723 -

marco 15 years ago
parent
commit
357073fc4b
7 changed files with 157 additions and 72 deletions
  1. 11 58
      ide/Makefile
  2. 10 0
      ide/Makefile.fpc
  3. 103 8
      ide/fpdebug.pas
  4. 4 0
      ide/globdir.inc
  5. 8 1
      packages/gdbint/Makefile
  6. 7 0
      packages/gdbint/Makefile.fpc
  7. 14 5
      packages/gdbint/src/gdbint.pp

+ 11 - 58
ide/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/08/02]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/11/05]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -286,7 +286,7 @@ ifeq ($(LIBGDBFILE),)
 SYSLIBDIR=/lib /usr/lib /usr/local/lib
 override LIBGDBFILE=$(firstword $(wildcard $(addsuffix /libgdb.a,$(SYSLIBDIR))))
 ifneq (${LIBGDBFILE},)
-$(warning Using system sefault libgdb file located in ${LIBGDBFILE})
+$(warning Using system default libgdb file located in ${LIBGDBFILE})
 GDBLIBDIR=$(dir ${LIBGDBFILE})
 endif
 endif
@@ -294,6 +294,14 @@ ifeq ($(LIBGDBFILE),)
 GDB=
 else
 GDB=1
+override LIBGDBINC:=$(firstword $(wildcard $(addsuffix /gdblib.inc,$(GDBLIBDIR))))
+ifeq ($(LIBGDBINC),)
+GDBLIBINCFOUND=0
+GDBLIBINCCOND=
+else
+GDBLIBINCFOUND=1
+GDBLIBINCCOND=-dUSE_GDBLIBINC -I$(GDBLIBDIR)
+endif
 endif
 ifdef GDB
 override LIBDIR+=$(GDBLIBDIR)
@@ -1648,8 +1656,6 @@ REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_GDBINT=1
 REQUIRE_PACKAGES_REGEXPR=1
-REQUIRE_PACKAGES_WINUNITS-BASE=1
-REQUIRE_PACKAGES_WINUNITS-JEDI=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_CHM=1
@@ -2025,8 +2031,6 @@ REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_GDBINT=1
 REQUIRE_PACKAGES_REGEXPR=1
-REQUIRE_PACKAGES_WINUNITS-BASE=1
-REQUIRE_PACKAGES_WINUNITS-JEDI=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_CHM=1
@@ -2407,58 +2411,6 @@ ifdef UNITDIR_GRAPH
 override COMPILER_UNITDIR+=$(UNITDIR_GRAPH)
 endif
 endif
-ifdef REQUIRE_PACKAGES_WINUNITS-BASE
-PACKAGEDIR_WINUNITS-BASE:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits-base/Makefile.fpc,$(PACKAGESDIR))))))
-ifneq ($(PACKAGEDIR_WINUNITS-BASE),)
-ifneq ($(wildcard $(PACKAGEDIR_WINUNITS-BASE)/units/$(TARGETSUFFIX)),)
-UNITDIR_WINUNITS-BASE=$(PACKAGEDIR_WINUNITS-BASE)/units/$(TARGETSUFFIX)
-else
-UNITDIR_WINUNITS-BASE=$(PACKAGEDIR_WINUNITS-BASE)
-endif
-ifdef CHECKDEPEND
-$(PACKAGEDIR_WINUNITS-BASE)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_WINUNITS-BASE) $(FPCMADE)
-override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS-BASE)/$(FPCMADE)
-endif
-else
-PACKAGEDIR_WINUNITS-BASE=
-UNITDIR_WINUNITS-BASE:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits-base/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_WINUNITS-BASE),)
-UNITDIR_WINUNITS-BASE:=$(firstword $(UNITDIR_WINUNITS-BASE))
-else
-UNITDIR_WINUNITS-BASE=
-endif
-endif
-ifdef UNITDIR_WINUNITS-BASE
-override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS-BASE)
-endif
-endif
-ifdef REQUIRE_PACKAGES_WINUNITS-JEDI
-PACKAGEDIR_WINUNITS-JEDI:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /winunits-jedi/Makefile.fpc,$(PACKAGESDIR))))))
-ifneq ($(PACKAGEDIR_WINUNITS-JEDI),)
-ifneq ($(wildcard $(PACKAGEDIR_WINUNITS-JEDI)/units/$(TARGETSUFFIX)),)
-UNITDIR_WINUNITS-JEDI=$(PACKAGEDIR_WINUNITS-JEDI)/units/$(TARGETSUFFIX)
-else
-UNITDIR_WINUNITS-JEDI=$(PACKAGEDIR_WINUNITS-JEDI)
-endif
-ifdef CHECKDEPEND
-$(PACKAGEDIR_WINUNITS-JEDI)/$(FPCMADE):
-	$(MAKE) -C $(PACKAGEDIR_WINUNITS-JEDI) $(FPCMADE)
-override ALLDEPENDENCIES+=$(PACKAGEDIR_WINUNITS-JEDI)/$(FPCMADE)
-endif
-else
-PACKAGEDIR_WINUNITS-JEDI=
-UNITDIR_WINUNITS-JEDI:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /winunits-jedi/Package.fpc,$(UNITSDIR)))))
-ifneq ($(UNITDIR_WINUNITS-JEDI),)
-UNITDIR_WINUNITS-JEDI:=$(firstword $(UNITDIR_WINUNITS-JEDI))
-else
-UNITDIR_WINUNITS-JEDI=
-endif
-endif
-ifdef UNITDIR_WINUNITS-JEDI
-override COMPILER_UNITDIR+=$(UNITDIR_WINUNITS-JEDI)
-endif
-endif
 ifdef REQUIRE_PACKAGES_UNIVINT
 PACKAGEDIR_UNIVINT:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /univint/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(PACKAGEDIR_UNIVINT),)
@@ -3342,6 +3294,7 @@ compiler/$(FPCMADE):
 compilerclean :
 	$(MAKE) -C compiler clean
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
+	$(COMPILER) $(GDBLIBINCCOND) fp.pas
 buildfp:
 	$(MAKE) compilerunits
 	$(MAKE) testgdb

+ 10 - 0
ide/Makefile.fpc

@@ -78,6 +78,15 @@ ifeq ($(LIBGDBFILE),)
 GDB=
 else
 GDB=1
+# Detect if gdblib.inc is available
+override LIBGDBINC:=$(firstword $(wildcard $(addsuffix /gdblib.inc,$(GDBLIBDIR))))
+ifeq ($(LIBGDBINC),)
+GDBLIBINCFOUND=0
+GDBLIBINCCOND=
+else
+GDBLIBINCFOUND=1
+GDBLIBINCCOND=-dUSE_GDBLIBINC -I$(GDBLIBDIR)
+endif
 endif
 
 ifdef GDB
@@ -157,6 +166,7 @@ compilerclean :
 # to use.
 #
 fp$(EXEEXT): $(wildcard *.pas) $(wildcard *.inc)
+        $(COMPILER) $(GDBLIBINCCOND) fp.pas
 
 buildfp:
         $(MAKE) compilerunits

+ 103 - 8
ide/fpdebug.pas

@@ -51,6 +51,7 @@ type
      HasExe   : boolean;
      RunCount : longint;
      WindowWidth : longint;
+     TBreakNumber : longint;
      FPCBreakErrorNumber : longint;
 {$ifdef SUPPORT_REMOTE}
      isRemoteDebugging:boolean;
@@ -65,6 +66,9 @@ type
     procedure DoBreakSession;virtual;}
     procedure DoEndSession(code:longint);virtual;
     procedure DoUserSignal;virtual;
+    procedure FlushAll; virtual;
+    function Query(question : pchar; args : pchar) : longint; virtual;
+
     procedure AnnotateError;
     procedure InsertBreakpoints;
     procedure RemoveBreakpoints;
@@ -334,8 +338,10 @@ uses
 {$ifdef DOS}
   fpusrscr,
 {$endif DOS}
+
   App,Strings,
   FVConsts,
+  MsgBox,
 {$ifdef Windows}
   Windebug,
 {$endif Windows}
@@ -603,7 +609,8 @@ procedure UpdateDebugViews;
 
   begin
 {$ifdef SUPPORT_REMOTE}
-     PushStatus(msg_getting_info_on+RemoteMachine);
+     if isRemoteDebugging then
+       PushStatus(msg_getting_info_on+RemoteMachine);
 {$endif SUPPORT_REMOTE}
      DeskTop^.Lock;
      If assigned(StackWindow) then
@@ -620,7 +627,8 @@ procedure UpdateDebugViews;
        VectorWindow^.Update;
      DeskTop^.UnLock;
 {$ifdef SUPPORT_REMOTE}
-     PopStatus;
+     if isRemoteDebugging then
+       PopStatus;
 {$endif SUPPORT_REMOTE}
   end;
 
@@ -648,6 +656,10 @@ begin
     begin
       LoadFile(f);
       HasExe:=true;
+      { Procedure HandleErrorAddrFrame
+         (Errno : longint;addr,frame : longint);
+         [public,alias:'FPC_BREAK_ERROR'];
+      Command('b HANDLEERRORADDRFRAME'); }
       Command('b FPC_BREAK_ERROR');
       FPCBreakErrorNumber:=last_breakpoint_number;
 {$ifdef FrameNameKnown}
@@ -826,6 +838,8 @@ begin
            PopStatus;
            exit;
         end;
+      s:=IDEApp.GetRemoteExecString;
+      MessageBox(#3'Start in remote'#13#3+s,nil,mfOKbutton);
       PopStatus;
     end
   else
@@ -941,6 +955,76 @@ begin
     GDBWindow^.WriteString(S);
 end;
 
+function TDebugController.Query(question : pchar; args : pchar) : longint;
+var
+  c : char;
+  WasModal : boolean;
+  ModalView : PView;
+  res : longint;
+begin
+  if not assigned(Application) then
+    begin
+      system.Write(question);
+      repeat
+        system.write('(y or n)');
+        system.read(c);
+        system.writeln(c);
+      until (lowercase(c)='y') or (lowercase(c)='n');
+      if lowercase(c)='y' then
+        query:=1
+      else
+        query:=0;
+      exit;
+    end;
+  if assigned(Application^.Current) and
+     ((Application^.Current^.State and sfModal)<>0) then
+    begin
+      WasModal:=true;
+      ModalView:=Application^.Current;
+      ModalView^.SetState(sfModal, false);
+      ModalView^.Hide;
+    end
+  else
+    WasModal:=false;
+  PushStatus(Question);
+  res:=MessageBox(Question,nil,mfyesbutton+mfnobutton);
+  PopStatus;
+  if res=cmYes then
+    Query:=1
+  else
+    Query:=0;
+  if WasModal then
+    begin
+      ModalView^.Show;
+      ModalView^.SetState(sfModal, true);
+      ModalView^.Draw;
+    end;
+end;
+
+procedure TDebugController.FlushAll;
+begin
+  if assigned(GDBWindow) then
+    begin
+      If StrLen(GetError)>0 then
+        begin
+          GDBWindow^.WriteErrorText(GetError);
+          if in_command=0 then
+            gdberrorbuf.reset;
+        end;
+
+      If StrLen(GetOutput)>0 then
+        begin
+          GDBWindow^.WriteOutputText(GetOutput);
+          { Keep output for command results }
+          if in_command=0 then
+            gdboutputbuf.reset;
+        end;
+    end
+  else
+    Inherited FlushAll;
+end;
+
+
 procedure TDebugController.CommandEnd(const s:string);
 begin
   if assigned(GDBWindow) and (in_command<=1) then
@@ -1269,7 +1353,13 @@ begin
        end
       else if not assigned(PB) then
         begin
-          WarningBox(#3'Stopped by breakpoint '+IntToStr(BreakIndex),nil);
+          if (BreakIndex<>start_break_number) and
+             (BreakIndex<>TbreakNumber) then
+            WarningBox(#3'Stopped by breakpoint '+IntToStr(BreakIndex),nil);
+          if BreakIndex=start_break_number then
+            start_break_number:=0;
+          if BreakIndex=TbreakNumber then
+            TbreakNumber:=0;
         end
       { For watch we should get old and new value !! }
       else if (Not assigned(GDBWindow) or not GDBWindow^.GetState(sfActive)) and
@@ -1377,14 +1467,15 @@ begin
   if NoSwitch then
     begin
 {$ifdef SUPPORT_REMOTE}
-      PushStatus(msg_runningremotely+RemoteMachine);
-{$else not SUPPORT_REMOTE}
+      if isRemoteDebugging then
+        PushStatus(msg_runningremotely+RemoteMachine)
+      else
+{$endif SUPPORT_REMOTE}
 {$ifdef Unix}
       PushStatus(msg_runninginanotherwindow+DebuggeeTTY);
 {$else not Unix}
       PushStatus(msg_runninginanotherwindow);
 {$endif Unix}
-{$endif not SUPPORT_REMOTE}
     end
   else
     begin
@@ -3508,15 +3599,17 @@ end;
 
 function GetGDBTargetShortName : string;
 begin
+{$ifndef CROSSGDB}
+GetGDBTargetShortName:=source_info.shortname;
+{$else CROSSGDB}
 {$ifdef SUPPORT_REMOTE}
 {$ifdef PALMOSGDB}
 GetGDBTargetShortName:='palmos';
 {$else}
 GetGDBTargetShortName:='linux';
 {$endif PALMOSGDB}
-{$else not SUPPORT_REMOTE}
-GetGDBTargetShortName:=source_info.shortname
 {$endif not SUPPORT_REMOTE}
+{$endif CROSSGDB}
 end;
 
 procedure InitDebugger;
@@ -3556,6 +3649,7 @@ begin
 {$endif}
 
   NeedRecompileExe:=false;
+{$ifndef SUPPORT_REMOTE}
   if UpCaseStr(TargetSwitches^.GetCurrSelParam)<>UpCaseStr(GetGDBTargetShortName) then
     begin
      ClearFormatParams;
@@ -3575,6 +3669,7 @@ begin
          IDEApp.UpdateTarget;
        end;
     end;
+{$endif ndef SUPPORT_REMOTE}
   if not NeedRecompileExe then
     NeedRecompileExe:=(not ExistsFile(ExeFile)) or (CompilationPhase<>cpDone) or
      (PrevMainFile<>MainFile) or NeedRecompile(cRun,false);

+ 4 - 0
ide/globdir.inc

@@ -10,6 +10,10 @@
 
  **********************************************************************}
 
+{$ifdef USE_GDBLIBINC}
+  {$include gdblib.inc}
+{$endif USE_GDBLIBINC}
+
 { --- Special OS settings --- }
 {$ifdef Go32V2}
   {$define SUPPORTVESA}

+ 8 - 1
packages/gdbint/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/11/03]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/11/05]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
@@ -2988,6 +2988,7 @@ gdbver.inc:
 gdbint$(PPUEXT): gdbint.pp gdbver.inc
 	@$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
 	$(COMPILER) -d$(GDBVER) $(GDBLIBINCCOND)  -Fisrc -Fusrc src/gdbint.pp
+	$(DEL) src/gdbver.inc
 endif
 else
 GDBVER=GDB_V606
@@ -2998,6 +2999,12 @@ gdbint$(PPUEXT): gdbint.pp gdbver.inc
 	$(COMPILER) -d$(GDBVER) $(GDBLIBINCCOND)  -Fisrc -Fusrc src/gdbint.pp
 endif
 gdbcon$(PPUEXT): gdbcon.pp gdbint$(PPUEXT)
+ifeq ($(wildcard $(GDBLIBDIR)/libmingw32.a),)
+	$(COMPILER) src/gdbcon.pp
+else
+	$(COMPILER) -dUSE_MINGW_GDB src/gdbcon.pp
+endif
+	$(EXECPPAS)
 ifeq ($(OS_TARGET),go32v2)
 DBGCOM=dbgcom$(OEXT)
 else

+ 7 - 0
packages/gdbint/Makefile.fpc

@@ -117,6 +117,7 @@ gdbver.inc:
 gdbint$(PPUEXT): gdbint.pp gdbver.inc
 	@$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
 	$(COMPILER) -d$(GDBVER) $(GDBLIBINCCOND)  -Fisrc -Fusrc src/gdbint.pp
+        $(DEL) src/gdbver.inc
 endif
 
 else
@@ -130,6 +131,12 @@ gdbint$(PPUEXT): gdbint.pp gdbver.inc
 endif
 
 gdbcon$(PPUEXT): gdbcon.pp gdbint$(PPUEXT)
+ifeq ($(wildcard $(GDBLIBDIR)/libmingw32.a),)
+        $(COMPILER) src/gdbcon.pp
+else
+        $(COMPILER) -dUSE_MINGW_GDB src/gdbcon.pp
+endif
+	$(EXECPPAS)
 
 ifeq ($(OS_TARGET),go32v2)
 DBGCOM=dbgcom$(OEXT)

+ 14 - 5
packages/gdbint/src/gdbint.pp

@@ -15,6 +15,9 @@ unit GdbInt;
 
 {$mode objfpc}
 
+{$define NotImplemented}
+
+{$define COMPILING_GDBINT_UNIT}
 {$ifdef USE_GDBLIBINC}
   {$i gdblib.inc}
 {$else not USE_GDBLIBINC}
@@ -32,7 +35,6 @@ interface
 
 {$smartlink off}
 
-{$define NotImplemented}
 
 { Is create_breakpoint_hook deprecated? }
 { Seem not so for 6.1 }
@@ -124,7 +126,6 @@ interface
   {$define GDB_HAS_DEBUG_FILE_DIRECTORY}
   {$define GDB_HAS_OBSERVER_NOTIFY_BREAKPOINT_CREATED}
   {$define GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
-  {$define GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
   {$define GDB_HAS_BP_NONE}
 {$endif def GDB_V7}
 
@@ -291,7 +292,9 @@ interface
     {$LINKLIB libmingw32.a}
     {$LINKLIB libmsvcrt.a}
     {$LINKLIB libdecnumber.a}
-    {$undef GDB_HAS_DEBUG_FILE_DIRECTORY}
+    {$ifdef GDB_USES_EXPAT_LIB}
+      {$LINKLIB expat}
+    {$endif GDB_USES_EXPAT_LIB}
   {$else not USE_MINGW_GDB}
     {$LINKLIB libiconv.a}
     {$LINKLIB libncurses.a}
@@ -767,6 +770,11 @@ type
           line : longint;
           pc : CORE_ADDR;
           _end : CORE_ADDR;
+          { Added fields, not used in gdbint,
+            but necessary to allocated enough space to
+            avoid stack memory corruption PM }
+          explicit_pc : longint;
+          explicit_line : longint;
        end;
 
      symtabs_and_lines = record
@@ -1276,8 +1284,8 @@ procedure gdb_init(argv0 : pchar);cdecl;external;
 procedure gdb_init;cdecl;external;
 {$endif not GDB_INIT_HAS_ARGV0}
 procedure execute_command(p:pchar;i:longint);cdecl;external;
-procedure target_kill;cdecl;external;
 {$ifdef GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
+procedure target_kill;cdecl;external;
 procedure target_close(pt : ptarget_ops; i:longint);cdecl;external;
 {$else not GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
 procedure target_close(i:longint);cdecl;external;
@@ -2287,10 +2295,11 @@ procedure tgdbinterface.gdb_done;
 begin
   if debuggee_started then
     begin
-      target_kill;
 {$ifdef GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
+      target_kill;
       target_close(@current_target,1);
 {$else not GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
+      current_target.to_kill;
       target_close(1);
 {$endif ndef GDB_TARGET_CLOSE_HAS_PTARGET_ARG}
     end;