Browse Source

Merged revisions 5696-5697,5713,5728,5780,5801 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r5696 | pierre | 2006-12-24 02:30:10 +0100 (Sun, 24 Dec 2006) | 4 lines

+ DontClearGraphMemory added to be able to start a mode
without clearing everything (needed for IDE)
* tried to clean assembler problems due to regcall
conventions
........
r5697 | pierre | 2006-12-24 02:32:53 +0100 (Sun, 24 Dec 2006) | 4 lines

+ GDB 6.6 added
GDB 6.1 (for go32v2 target added)
GDB_HAS_DEPRECATED_CBPH defined for versions where
create_breakpoint_hook is deprecated.
........
r5713 | daniel | 2006-12-25 23:42:34 +0100 (Mon, 25 Dec 2006) | 2 lines

* Disable go32v2 ifdef.

........
r5728 | pierre | 2006-12-28 09:17:14 +0100 (Thu, 28 Dec 2006) | 1 line

* go32v2 signals are also cdecl now
........
r5780 | pierre | 2007-01-02 00:22:05 +0100 (Tue, 02 Jan 2007) | 2 lines

+ added CAN_RUN_GDBVER, to allow to cross-compile
the IDE from win32 to go32v2.
........
r5801 | pierre | 2007-01-04 09:13:13 +0100 (Thu, 04 Jan 2007) | 1 line

* fix compilation of wviews unit for go32v2
........

git-svn-id: branches/fixes_2_0@5862 -

pierre 19 years ago
parent
commit
d9e256e98a

+ 27 - 0
ide/Makefile

@@ -1411,6 +1411,7 @@ REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_GDBINT=1
 REQUIRE_PACKAGES_REGEXPR=1
+REQUIRE_PACKAGES_GRAPH=1
 endif
 ifeq ($(FULL_TARGET),i386-win32)
 REQUIRE_PACKAGES_RTL=1
@@ -1750,6 +1751,32 @@ ifdef UNITDIR_REGEXPR
 override COMPILER_UNITDIR+=$(UNITDIR_REGEXPR)
 endif
 endif
+ifdef REQUIRE_PACKAGES_GRAPH
+PACKAGEDIR_GRAPH:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /graph/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_GRAPH),)
+ifneq ($(wildcard $(PACKAGEDIR_GRAPH)/units/$(TARGETSUFFIX)),)
+UNITDIR_GRAPH=$(PACKAGEDIR_GRAPH)/units/$(TARGETSUFFIX)
+else
+UNITDIR_GRAPH=$(PACKAGEDIR_GRAPH)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_GRAPH)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_GRAPH) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_GRAPH)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_GRAPH=
+UNITDIR_GRAPH:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /graph/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_GRAPH),)
+UNITDIR_GRAPH:=$(firstword $(UNITDIR_GRAPH))
+else
+UNITDIR_GRAPH=
+endif
+endif
+ifdef UNITDIR_GRAPH
+override COMPILER_UNITDIR+=$(UNITDIR_GRAPH)
+endif
+endif
 ifndef NOCPUDEF
 override FPCOPTDEF=$(CPU_TARGET)
 endif

+ 1 - 0
ide/Makefile.fpc

@@ -22,6 +22,7 @@ options=-Sg
 
 [require]
 packages=fv gdbint regexpr
+packages_go32v2=graph
 libc=y
 
 [default]

+ 1 - 1
ide/fpcalc.pas

@@ -233,7 +233,7 @@ const
 {$ifdef Unix}
 Procedure CalcSigFPE(sig : longint);cdecl;
 {$else}
-function CalcSigFPE(sig : longint) : longint;{$ifndef go32v2}cdecl;{$endif}
+function CalcSigFPE(sig : longint) : longint;cdecl;
 {$endif}
 begin
 {$ifdef CPUI386}

+ 4 - 1
ide/fpstring.pas

@@ -13,7 +13,10 @@
 
  **********************************************************************}
 {$i globdir.inc}
-{$ifdef USERESSTRINGS}{$mode objfpc}{$endif}
+{$ifdef USERESSTRINGS}
+{$mode objfpc}
+{$endif USERESSTRINGS}
+
 unit fpstring;
 
   interface

+ 78 - 17
packages/base/gdbint/Makefile

@@ -1,8 +1,8 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/02/06]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2006/08/21]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince powerpc64-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos sparc-linux sparc-netbsd sparc-solaris x86_64-linux x86_64-freebsd x86_64-win64 arm-linux arm-palmos arm-wince arm-gba powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
@@ -288,6 +288,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_UNITS+=gdbint gdbcon
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_UNITS+=gdbint gdbcon
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_UNITS+=gdbint gdbcon
 endif
@@ -327,6 +330,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override TARGET_UNITS+=gdbint gdbcon
 endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_UNITS+=gdbint gdbcon
+endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_UNITS+=gdbint gdbcon
 endif
@@ -363,6 +369,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_UNITS+=gdbint gdbcon
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_UNITS+=gdbint gdbcon
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_UNITS+=gdbint gdbcon
 endif
@@ -402,6 +411,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override TARGET_EXAMPLES+=testgdb symify
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_EXAMPLES+=testgdb symify
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override TARGET_EXAMPLES+=testgdb symify
 endif
@@ -441,6 +453,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override TARGET_EXAMPLES+=testgdb symify
 endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_EXAMPLES+=testgdb symify
+endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override TARGET_EXAMPLES+=testgdb symify
 endif
@@ -477,6 +492,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_EXAMPLES+=testgdb symify
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_EXAMPLES+=testgdb symify
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_EXAMPLES+=testgdb symify
 endif
@@ -517,6 +535,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
@@ -556,6 +577,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
@@ -592,6 +616,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_OBJECTDIR+=$(GDBLIBDIR)
 endif
@@ -631,6 +658,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
@@ -670,6 +700,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
@@ -706,6 +739,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_LIBRARYDIR+=$(GDBLIBDIR)
 endif
@@ -948,6 +984,7 @@ STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(OS_TARGET),go32v1)
@@ -1060,6 +1097,11 @@ EXEEXT=
 HASSHAREDLIB=1
 SHORTSUFFIX=dwn
 endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
 else
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
@@ -1128,7 +1170,7 @@ endif
 ifeq ($(OS_TARGET),amiga)
 EXEEXT=
 PPUEXT=.ppu
-ASMEXT=.asm
+ASMEXT=.s
 OEXT=.o
 SMARTEXT=.sl
 STATICLIBEXT=.a
@@ -1380,12 +1422,17 @@ endif
 endif
 export ZIPPROG
 ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
 TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
 ifeq ($(TARPROG),)
 TARPROG= __missing_command_TARPROG
 else
 TARPROG:=$(firstword $(TARPROG))
 endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
 endif
 export TARPROG
 ASNAME=$(BINUTILSPREFIX)as
@@ -1509,6 +1556,9 @@ endif
 ifeq ($(FULL_TARGET),i386-wdosx)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),i386-emx)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1548,6 +1598,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc-macos)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1584,6 +1637,9 @@ endif
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1619,6 +1675,9 @@ endif
 ifneq ($(OS_TARGET),$(OS_SOURCE))
 override FPCOPT+=-T$(OS_TARGET)
 endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
 ifeq ($(OS_SOURCE),openbsd)
 override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
@@ -1653,14 +1712,15 @@ override FPCOPT+=-gl
 override FPCOPTDEF+=DEBUG
 endif
 ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
 ifeq ($(CPU_TARGET),i386)
 FPCCPUOPT:=-OG2p3
-else
+endif
 ifeq ($(CPU_TARGET),powerpc)
 FPCCPUOPT:=-O1r
-else
-FPCCPUOPT:=
 endif
+else
+FPCCPUOPT:=-O1r
 endif
 override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
 override FPCOPTDEF+=RELEASE
@@ -1669,9 +1729,7 @@ ifdef STRIP
 override FPCOPT+=-Xs
 endif
 ifdef OPTIMIZE
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-OG2p3
-endif
+override FPCOPT+=-O2
 endif
 ifdef VERBOSE
 override FPCOPT+=-vwni
@@ -1715,11 +1773,6 @@ override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
 override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
 endif
 endif
-ifeq ($(OS_TARGET),linux)
-ifeq ($(FPC_VERSION),1.0.6)
-override FPCOPTDEF+=HASUNIX
-endif
-endif
 ifdef CREATESHARED
 override FPCOPT+=-Cg
 ifeq ($(CPU_TARGET),i386)
@@ -1782,7 +1835,7 @@ ifneq ($(TARGET_EXAMPLES),)
 HASEXAMPLES=1
 override EXAMPLESOURCEFILES:=$(wildcard $(addsuffix .pp,$(TARGET_EXAMPLES)) $(addsuffix .pas,$(TARGET_EXAMPLES)) $(addsuffix .lpr,$(TARGET_EXAMPLES)) $(addsuffix .dpr,$(TARGET_EXAMPLES)))
 override EXAMPLEFILES:=$(addsuffix $(EXEEXT),$(TARGET_EXAMPLES))
-override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
+override EXAMPLEOFILES:=$(addsuffix $(OEXT),$(TARGET_EXAMPLES)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_EXAMPLES)))
 override CLEANEXEFILES+=$(EXAMPLEFILES) $(EXAMPLEOFILES)
 ifeq ($(OS_TARGET),os2)
 override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_EXAMPLES))
@@ -1876,7 +1929,7 @@ ifdef INSTALL_BUILDUNIT
 override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
 endif
 ifdef INSTALLPPUFILES
-override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
 ifneq ($(UNITTARGETDIRPREFIX),)
 override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
 override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
@@ -2028,7 +2081,7 @@ ifdef CLEAN_UNITS
 override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
 endif
 ifdef CLEANPPUFILES
-override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
 ifdef DEBUGSYMEXT
 override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
 endif
@@ -2217,6 +2270,14 @@ ifneq ($(wildcard fpcmake.loc),)
 include fpcmake.loc
 endif
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+CAN_RUN_GDBVER=1
+endif
+ifeq ($(FULL_SOURCE),i386-win32)
+ifeq ($(FULL_TARGET),i386-go32v2)
+CAN_RUN_GDBVER=1
+endif
+endif
+ifdef CAN_RUN_GDBVER
 ifeq ($(GDBFOUND),1)
 $(CURRDIR)getver$(EXEEXT) : gdbver.pp
 	$(COMPILER) -o$(CURRDIR)getver$(EXEEXT) gdbver.pp

+ 25 - 14
packages/base/gdbint/Makefile.fpc

@@ -2,6 +2,7 @@
 #   Makefile.fpc for Free Pascal GDB Interface
 #
 
+
 [package]
 name=gdbint
 version=2.0.5
@@ -58,40 +59,50 @@ endif
 
 [rules]
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+CAN_RUN_GDBVER=1
+endif
+
+ifeq ($(FULL_SOURCE),i386-win32)
+ifeq ($(FULL_TARGET),i386-go32v2)
+CAN_RUN_GDBVER=1
+endif
+endif
+
 
+ifdef CAN_RUN_GDBVER
 ifeq ($(GDBFOUND),1)
 # libgdb.a found
 
 $(CURRDIR)getver$(EXEEXT) : gdbver.pp
-        $(COMPILER) -o$(CURRDIR)getver$(EXEEXT) gdbver.pp
+	$(COMPILER) -o$(CURRDIR)getver$(EXEEXT) gdbver.pp
 
 ifndef GOTGDBVER
 # gdbver doesn't exists, build it first
 gdbint$(PPUEXT): $(CURRDIR)gdbver$(EXEEXT) gdbint.pp
-        $(MAKE) gdbint$(PPUEXT) GOTGDBVER=1
+	$(MAKE) gdbint$(PPUEXT) GOTGDBVER=1
 else
 # gdbver exists
 GDBVER:=GDB_V$(strip $(shell $(CURRDIR)gdbver$(EXEEXT) -n))
 gdbint$(PPUEXT): gdbint.pp
-        @$(ECHO) Using GDB $(GDBVER)
-        $(COMPILER) -d$(GDBVER) gdbint.pp
-        $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
+	@$(ECHO) Using GDB $(GDBVER)
+	$(COMPILER) -d$(GDBVER) gdbint.pp
+	$(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
 endif
 
 else
 # libgdb.a not found, default to libgdb v5
 GDBVER=GDB_V6
 gdbint$(PPUEXT): gdbint.pp
-        @$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
-        $(COMPILER) -d$(GDBVER) gdbint.pp
+	@$(ECHO) libgdb.a not found, using default GDB $(GDBVER)
+	$(COMPILER) -d$(GDBVER) gdbint.pp
 endif
 
 else
 # Different OS_TARGET, default to libgdb v5
 GDBVER=GDB_V5
 gdbint$(PPUEXT): gdbint.pp
-        @$(ECHO) Different target os or cpu, using default GDB $(GDBVER)
-        $(COMPILER) -d$(GDBVER) gdbint.pp
+	@$(ECHO) Different target os or cpu, using default GDB $(GDBVER)
+	$(COMPILER) -d$(GDBVER) gdbint.pp
 endif
 
 gdbcon$(PPUEXT): gdbcon.pp gdbint$(PPUEXT)
@@ -108,15 +119,15 @@ ifdef $(COMPILEDBGCOM)
 # on the fact that all files are opened via C lib calls
 # which is wrong for FPC !!
 $(DBGCOM): ../v4.16/dbgcom.c
-        gcc -c -DFPC -Dother_sel -gstabs -o dbgcom.o -I../v4.16 ../v4.16/dbgcom.c
+	gcc -c -DFPC -Dother_sel -gstabs -o dbgcom.o -I../v4.16 ../v4.16/dbgcom.c
 else
 $(DBGCOM):
 endif
 
 simple: $(DBGCOM)
-        -rm gdbint.ppu
-        ppc386 -dUSE_LIBGDB gdbint
-        ppc386 testgdb
+	-rm gdbint.ppu
+	ppc386 -dUSE_LIBGDB gdbint
+	ppc386 testgdb
 
 testgdb$(EXEEXT): testgdb.pp gdbint$(PPUEXT) gdbcon$(PPUEXT) $(DBGCOM)
 
@@ -126,5 +137,5 @@ testgdb$(EXEEXT): testgdb.pp gdbint$(PPUEXT) gdbcon$(PPUEXT) $(DBGCOM)
 test: examples
 
 clean: fpc_clean
-        $(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
+	$(DEL) gdbver$(EXEEXT) gdbver$(OEXT)
 

+ 32 - 4
packages/base/gdbint/gdbint.pp

@@ -20,21 +20,44 @@ interface
 {.$define DebugCommand}
 {$define NotImplemented}
 
+{ Is create_breakpoint_hook deprecated? }
+{ Seem not so for 6.1 }
+{$define GDB_HAS_DEPRECATED_CBPH}
+
+{ 6.1.x }
+{$ifdef GDB_V601}
+  {$info using gdb 6.1.x}
+  {$define GDB_V6}
+  {$define GDB_HAS_DB_COMMANDS}
+  {$undef GDB_HAS_DEPRECATED_CBPH}
+{$endif def GDB_V601}
+
 { 6.2.x }
 {$ifdef GDB_V602}
   {$define GDB_V6}
+  {$define GDB_HAS_DB_COMMANDS}
 {$endif def GDB_V602}
 
 { 6.3.x }
 {$ifdef GDB_V603}
   {$define GDB_V6}
+  {$define GDB_HAS_DB_COMMANDS}
 {$endif def GDB_V603}
 
 {$ifdef GDB_V604}
   {$define GDB_V6}
+  {$define GDB_HAS_DB_COMMANDS}
 {$endif def GDB_V604}
 
 
+{ 6.6.x }
+{$ifdef GDB_V606}
+  {$info using gdb 6.6.x}
+  {$define GDB_V6}
+  {$define GDB_HAS_DB_COMMANDS}
+  {$define GDB_NEEDS_NO_ERROR_INIT}
+{$endif def GDB_V605}
+
 {$ifdef GDB_V6}
   {$define GDB_HAS_SYSROOT}
   {$define GDB_SYMTAB_HAS_MACROS}
@@ -1029,7 +1052,7 @@ var
 { external variables }
   error_return : jmp_buf;cvar;
   quit_return  : jmp_buf;cvar;
-  {$ifdef GDB_V6}
+  {$ifdef GDB_HAS_DEPRECATED_CBPH}
   deprecated_create_breakpoint_hook : pointer;cvar;external;
   {$else}
   create_breakpoint_hook : pointer;cvar;external;
@@ -1049,10 +1072,12 @@ var
   tui_version : longint;cvar;public;
 
 { Whether xdb commands will be handled }
+{$ifdef GDB_HAS_DB_COMMANDS}
   xdb_commands : longint;cvar;public;
 
 { Whether dbx commands will be handled }
   dbx_commands : longint;cvar;public;
+{$endif GDB_HAS_DB_COMMANDS}
 
 var
   gdb_stdout : pui_file;cvar;public;
@@ -1996,7 +2021,7 @@ procedure tgdbinterface.gdb__init;
 begin
   gdboutputbuf.reset;
   gdberrorbuf.reset;
-  {$ifdef GDB_V6}
+  {$ifdef GDB_HAS_DEPRECATED_CBPH}
   deprecated_create_breakpoint_hook:=@CreateBreakPointHook;
   {$else}
   create_breakpoint_hook:=@CreateBreakPointHook;
@@ -2014,7 +2039,7 @@ begin
       current_target.to_kill;
       current_target.to_close(1);
     end;
-  {$ifdef GDB_V6}
+  {$ifdef GDB_HAS_DEPRECATED_CBPH}
   deprecated_create_breakpoint_hook:=nil;
   {$else}
   create_breakpoint_hook:=nil;
@@ -2460,8 +2485,11 @@ begin
 end;
 
 {$ifdef GDB_HAS_SYSROOT}
-var gdb_sysroot  : pchar; {$ifdef powerpc}external{$else}export{$endif} name 'gdb_sysroot';
+var gdb_sysroot  : pchar; cvar;public;
     gdb_sysrootc : char;
+    return_child_result : longbool;cvar;public;
+    return_child_result_value : longint;cvar;public;
+    batch_silent : longbool;cvar;public;
 {$endif}
 
 begin

+ 104 - 60
packages/base/graph/go32v2/graph.pp

@@ -52,6 +52,10 @@ const
   UseLFB : boolean = false;
   UseNoSelector : boolean = false;
   LFBPointer : pointer = nil;
+{ Helpful variable to get save/restore support in IDE PM }
+const
+  DontClearGraphMemory : boolean = false;
+
 
 
 implementation
@@ -162,55 +166,65 @@ const
           pop es
           pop esi
           pop edi
-       end ['ESI','EDI','ECX','EAX']
+       end ['ECX','EAX']
     end;
 
 {$endif tp}
 
- {************************************************************************}
- {*                     4-bit planar VGA mode routines                   *}
- {************************************************************************}
-
-  Procedure Init640x200x16; {$ifndef fpc}far;{$endif fpc} assembler;
-  { must also clear the screen...}
+ Procedure CallInt10(val_ax : word); assembler;
    asm
-     mov ax,000Eh
-{$ifdef fpc}
-     push ebp
-{$endif fpc}
-     int 10h
-{$ifdef fpc}
-     pop ebp
-{$endif fpc}
-   end;
-
-
-   Procedure Init640x350x16; {$ifndef fpc}far;{$endif fpc} assembler;
-  { must also clear the screen...}
-    asm
-      mov ax,0010h
+{$IFNDEF REGCALL}
+     mov ax,val_ax
+{$ENDIF REGCALL}
 {$ifdef fpc}
       push ebp
+      push esi
+      push edi
+      push ebx
 {$endif fpc}
       int 10h
 {$ifdef fpc}
+      pop ebx
+      pop edi
+      pop esi
       pop ebp
 {$endif fpc}
+   end;
+
+ {************************************************************************}
+ {*                     4-bit planar VGA mode routines                   *}
+ {************************************************************************}
+
+  Procedure Init640x200x16; {$ifndef fpc}far;{$endif fpc}
+    begin
+      if DontClearGraphMemory then
+        CallInt10($8e)
+      else
+        CallInt10($e);
     end;
 
-  procedure Init640x480x16; {$ifndef fpc}far;{$endif fpc} assembler;
-  { must also clear the screen...}
-    asm
-      mov  ax,0012h
-{$ifdef fpc}
-      push ebp
-{$endif fpc}
-      int  10h
-{$ifdef fpc}
-     pop ebp
-{$endif fpc}
+
+   Procedure Init640x350x16; {$ifndef fpc}far;{$endif fpc}
+    begin
+      if DontClearGraphMemory then
+        CallInt10($90)
+      else
+        CallInt10($10);
     end;
 
+
+
+  Procedure Init640x480x16; {$ifndef fpc}far;{$endif fpc}
+    begin
+      if DontClearGraphMemory then
+        CallInt10($92)
+      else
+        CallInt10($12);
+    end;
+
+
+
+
  Procedure PutPixel16(X,Y : smallint; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
 {$ifndef asmgraph}
  var offset: word;
@@ -313,9 +327,9 @@ const
         { restore enable set/reset register }
         mov  ax,0001h
         out  dx,ax
+ {$endif fpc}
         pop edi
         pop ebx
- {$endif fpc}
       end;
 {$endif asmgraph}
    end;
@@ -345,9 +359,6 @@ const
 {$else asmgraph}
     asm
   {$ifndef fpc}
-      push esi
-      push edi
-      push ebx
       mov   ax, [X]          { Get X address                    }
       push  ax
       shr   ax, 3
@@ -413,6 +424,9 @@ const
       xor   ah,ah
       mov   @Result, ax
   {$else fpc}
+      push esi
+      push edi
+      push ebx
       movzx eax, [X]          { Get X address                    }
       push  eax
       shr   eax, 3
@@ -660,9 +674,6 @@ End;
 {$else asmgraph}
 { note: still needs xor/or/and/notput support !!!!! (JM) }
     asm
-      push esi
-      push edi
-      push ebx
   {$ifndef fpc}
       mov  es, [SegA000]
       { enable the set / reset function and load the color }
@@ -708,6 +719,9 @@ End;
       mov  ax,0001h
       out  dx,ax
   {$else fpc}
+      push esi
+      push edi
+      push ebx
       { enable the set / reset function and load the color }
       mov  dx, 3ceh
       mov  ax, 0f01h
@@ -992,9 +1006,15 @@ End;
       mov ah,05h
 {$ifdef fpc}
       push ebp
+      push esi
+      push edi
+      push ebx
 {$endif fpc}
       int 10h
 {$ifdef fpc}
+      pop ebx
+      pop edi
+      pop esi
       pop ebp
 {$endif fpc}
 
@@ -1033,9 +1053,15 @@ End;
       mov ah,05h
 {$ifdef fpc}
       push ebp
+      push esi
+      push edi
+      push ebx
 {$endif fpc}
       int 10h
 {$ifdef fpc}
+      pop ebx
+      pop edi
+      pop esi
       pop ebp
 {$endif fpc}
     end;
@@ -1060,17 +1086,15 @@ End;
  {*                     320x200x256c Routines                            *}
  {************************************************************************}
 
- Procedure Init320; {$ifndef fpc}far;{$endif fpc} assembler;
-  asm
-    mov ax,0013h
-{$ifdef fpc}
-    push ebp
-{$endif fpc}
-    int 10h
-{$ifdef fpc}
-    pop ebp
-{$endif fpc}
-  end;
+ Procedure Init320; {$ifndef fpc}far;{$endif fpc}
+    begin
+      if DontClearGraphMemory then
+        CallInt10($93)
+      else
+        CallInt10($13);
+    end;
+
+
 
  Procedure PutPixel320(X,Y : smallint; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
  { x,y -> must be in local coordinates. Clipping if required. }
@@ -1277,6 +1301,11 @@ const CrtAddress: word = 0;
      MOV CRTAddress,DX
 
      MOV  AX, 0013h
+     MOV  BL, DontClearGraphMemory
+     OR   BL,BL
+     JZ   @L2
+     OR   AX, 080h
+  @L2:
 {$ifdef fpc}
      push ebp
 {$EndIf fpc}
@@ -1333,7 +1362,7 @@ const CrtAddress: word = 0;
      IN  AL,DX
      OR  AL,40h     {bit 6 := 1: memory access scheme=linear bit array      }
      OUT DX,AL
-  end;
+  end ['ESI','EDI','EBX','EAX'];
  end;
 
 
@@ -1376,6 +1405,7 @@ const CrtAddress: word = 0;
     mov al, ES:[DI]
     xor ah, ah
     mov @Result, ax
+  end;
   {$else fpc}
       push edi
       push ebx
@@ -1403,8 +1433,8 @@ const CrtAddress: word = 0;
     mov @Result, ax
     pop ebx
     pop edi
+   end ['ESI','EDI','EBX','EAX'];
   {$endif fpc}
-   end;
 {$endif asmgraph}
  end;
 
@@ -2003,6 +2033,11 @@ const CrtAddress: word = 0;
      { check if Hercules adapter supPorted ... }
      { check if EGA adapter supPorted...       }
      asm
+{$ifdef fpc}
+       push esi
+       push edi
+       push ebx
+{$endif fpc}
        mov ah,12h
        mov bx,0FF10h
 {$ifdef fpc}
@@ -2016,6 +2051,11 @@ const CrtAddress: word = 0;
        jz  @noega
        mov [EGADetected],TRUE
      @noega:
+{$ifdef fpc}
+       pop ebx
+       pop edi
+       pop esi
+{$endif fpc}
      end;
 {$ifdef logging}
      LogLn('EGA detected: '+strf(Longint(EGADetected)));
@@ -2024,6 +2064,11 @@ const CrtAddress: word = 0;
      if EGADetected then
        begin
         asm
+{$ifdef fpc}
+         push esi
+         push edi
+         push ebx
+{$endif fpc}
          mov ax,1a00h
 {$ifdef fpc}
          push ebp
@@ -2038,17 +2083,16 @@ const CrtAddress: word = 0;
          mov ax,1c00h       { get state size for save...     }
                             { ... all imPortant data         }
          mov cx,07h
-{$ifdef fpc}
-         push ebp
-{$endif fpc}
          int 10h
-{$ifdef fpc}
-         pop ebp
-{$endif fpc}
          cmp al,1ch         { success?                       }
          jne @novga
          mov [VGADetected],TRUE
         @novga:
+{$ifdef fpc}
+       pop ebx
+       pop edi
+       pop esi
+{$endif fpc}
         end;
        end;
 {$ifdef logging}
@@ -2774,6 +2818,6 @@ begin
     test ax,ax
     sete al
     mov  inWindows,al
-  end;
+  end ['ESI','EDI','EBX','EAX'];
   InitializeGraph;
 end.