Browse Source

+ Merge 5496,5504,5505,5513

git-svn-id: branches/fixes_2_0@5514 -
daniel 19 years ago
parent
commit
261295c8a9
10 changed files with 150 additions and 122 deletions
  1. 1 0
      .gitattributes
  2. 2 35
      Makefile
  3. 5 79
      ide/Makefile
  4. 1 0
      ide/Makefile.fpc
  5. 10 3
      ide/fp.pas
  6. 1 1
      ide/fpdebug.pas
  7. 89 0
      ide/fpevalw.pas
  8. 16 2
      ide/fpide.pas
  9. 22 0
      ide/fpmdebug.inc
  10. 3 2
      ide/fpredir.pas

+ 1 - 0
.gitattributes

@@ -1035,6 +1035,7 @@ ide/fpcygwin.pas svneol=native#text/plain
 ide/fpdebug.pas svneol=native#text/plain
 ide/fpdebug.pas svneol=native#text/plain
 ide/fpdesk.pas svneol=native#text/plain
 ide/fpdesk.pas svneol=native#text/plain
 ide/fpdpansi.pas svneol=native#text/plain
 ide/fpdpansi.pas svneol=native#text/plain
+ide/fpevalw.pas svneol=native#text/x-pascal
 ide/fphelp.pas svneol=native#text/plain
 ide/fphelp.pas svneol=native#text/plain
 ide/fpide.pas svneol=native#text/plain
 ide/fpide.pas svneol=native#text/plain
 ide/fpini.pas svneol=native#text/plain
 ide/fpini.pas svneol=native#text/plain

+ 2 - 35
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 [2005/12/07]
 #
 #
 default: help
 default: help
-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-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-wince powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -438,9 +438,6 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_DIRS+=compiler rtl utils fcl fv packages ide installer
 override TARGET_DIRS+=compiler rtl utils fcl fv packages ide installer
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_DIRS+=compiler rtl utils fcl fv packages ide installer
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_DIRS+=compiler rtl utils fcl fv packages ide installer
 override TARGET_DIRS+=compiler rtl utils fcl fv packages ide installer
 endif
 endif
@@ -631,9 +628,6 @@ endif
 ifndef INSTALL_DATADIR
 ifndef INSTALL_DATADIR
 INSTALL_DATADIR=$(INSTALL_BASEDIR)
 INSTALL_DATADIR=$(INSTALL_BASEDIR)
 endif
 endif
-ifndef INSTALL_SHAREDDIR
-INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
-endif
 ifdef CROSSCOMPILE
 ifdef CROSSCOMPILE
 ifndef CROSSBINDIR
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
 CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
@@ -654,7 +648,6 @@ ASMEXT=.s
 SMARTEXT=.sl
 SMARTEXT=.sl
 STATICLIBEXT=.a
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBEXT=.so
-SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1287,14 +1280,6 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 override FPCOPTDEF+=HASUNIX
 endif
 endif
 endif
 endif
-ifdef CREATESHARED
-override FPCOPT+=-Cg
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-Aas
-endif
-endif
-ifdef LINKSHARED
-endif
 ifdef OPT
 ifdef OPT
 override FPCOPT+=$(OPT)
 override FPCOPT+=$(OPT)
 endif
 endif
@@ -1309,14 +1294,6 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 export FPCEXTCMD
 endif
 endif
-override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
-override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
-ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
-override ACROSSCOMPILE=1
-endif
-ifdef ACROSSCOMPILE
-override FPCOPT+=$(CROSSOPT)
-endif
 override COMPILER:=$(FPC) $(FPCOPT)
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 EXECPPAS=
@@ -2004,16 +1981,6 @@ TARGET_DIRS_PACKAGES=1
 TARGET_DIRS_IDE=1
 TARGET_DIRS_IDE=1
 TARGET_DIRS_INSTALLER=1
 TARGET_DIRS_INSTALLER=1
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-TARGET_DIRS_COMPILER=1
-TARGET_DIRS_RTL=1
-TARGET_DIRS_UTILS=1
-TARGET_DIRS_FCL=1
-TARGET_DIRS_FV=1
-TARGET_DIRS_PACKAGES=1
-TARGET_DIRS_IDE=1
-TARGET_DIRS_INSTALLER=1
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_RTL=1
 TARGET_DIRS_RTL=1

+ 5 - 79
ide/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 [2005/12/07]
 #
 #
 default: all
 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-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-wince powerpc64-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -359,9 +359,6 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_DIRS+=compiler
 override TARGET_DIRS+=compiler
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_DIRS+=compiler
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_DIRS+=compiler
 override TARGET_DIRS+=compiler
 endif
 endif
@@ -473,9 +470,6 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 override TARGET_PROGRAMS+=fp
 override TARGET_PROGRAMS+=fp
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_PROGRAMS+=fp
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override TARGET_PROGRAMS+=fp
 override TARGET_PROGRAMS+=fp
 endif
 endif
@@ -589,9 +583,6 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 override COMPILER_OPTIONS+=-Sg
 override COMPILER_OPTIONS+=-Sg
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-override COMPILER_OPTIONS+=-Sg
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 override COMPILER_OPTIONS+=-Sg
 override COMPILER_OPTIONS+=-Sg
 endif
 endif
@@ -781,9 +772,6 @@ endif
 ifndef INSTALL_DATADIR
 ifndef INSTALL_DATADIR
 INSTALL_DATADIR=$(INSTALL_BASEDIR)
 INSTALL_DATADIR=$(INSTALL_BASEDIR)
 endif
 endif
-ifndef INSTALL_SHAREDDIR
-INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
-endif
 ifdef CROSSCOMPILE
 ifdef CROSSCOMPILE
 ifndef CROSSBINDIR
 ifndef CROSSBINDIR
 CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
 CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
@@ -803,11 +791,6 @@ GCCLIBDIR:=$(shell dirname `gcc -m32 -print-libgcc-file-name`)
 endif
 endif
 endif
 endif
 endif
 endif
-ifeq ($(CPU_TARGET),powerpc64)
-ifeq ($(BINUTILSPREFIX),)
-GCCLIBDIR:=$(shell dirname `gcc -m64 -print-libgcc-file-name`)
-endif
-endif
 endif
 endif
 ifndef GCCLIBDIR
 ifndef GCCLIBDIR
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
 CROSSGCC=$(strip $(wildcard $(addsuffix /$(BINUTILSPREFIX)gcc$(SRCEXEEXT),$(SEARCHPATH))))
@@ -835,7 +818,6 @@ ASMEXT=.s
 SMARTEXT=.sl
 SMARTEXT=.sl
 STATICLIBEXT=.a
 STATICLIBEXT=.a
 SHAREDLIBEXT=.so
 SHAREDLIBEXT=.so
-SHAREDLIBPREFIX=libfp
 STATICLIBPREFIX=libp
 STATICLIBPREFIX=libp
 RSTEXT=.rst
 RSTEXT=.rst
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
 ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
@@ -1572,12 +1554,6 @@ REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_GDBINT=1
 REQUIRE_PACKAGES_GDBINT=1
 REQUIRE_PACKAGES_REGEXPR=1
 REQUIRE_PACKAGES_REGEXPR=1
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-REQUIRE_PACKAGES_RTL=1
-REQUIRE_PACKAGES_FV=1
-REQUIRE_PACKAGES_GDBINT=1
-REQUIRE_PACKAGES_REGEXPR=1
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_FV=1
@@ -1801,14 +1777,6 @@ ifeq ($(FPC_VERSION),1.0.6)
 override FPCOPTDEF+=HASUNIX
 override FPCOPTDEF+=HASUNIX
 endif
 endif
 endif
 endif
-ifdef CREATESHARED
-override FPCOPT+=-Cg
-ifeq ($(CPU_TARGET),i386)
-override FPCOPT+=-Aas
-endif
-endif
-ifdef LINKSHARED
-endif
 ifdef GCCLIBDIR
 ifdef GCCLIBDIR
 override FPCOPT+=-Fl$(GCCLIBDIR)
 override FPCOPT+=-Fl$(GCCLIBDIR)
 endif
 endif
@@ -1829,14 +1797,6 @@ override FPCEXTCMD:=$(FPCOPT)
 override FPCOPT:=!FPCEXTCMD
 override FPCOPT:=!FPCEXTCMD
 export FPCEXTCMD
 export FPCEXTCMD
 endif
 endif
-override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
-override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
-ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
-override ACROSSCOMPILE=1
-endif
-ifdef ACROSSCOMPILE
-override FPCOPT+=$(CROSSOPT)
-endif
 override COMPILER:=$(FPC) $(FPCOPT)
 override COMPILER:=$(FPC) $(FPCOPT)
 ifeq (,$(findstring -s ,$(COMPILER)))
 ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 EXECPPAS=
@@ -1866,7 +1826,7 @@ ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)
 override CLEANRSTFILES+=$(RSTFILES)
 endif
 endif
-.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release
 $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
 $(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 	@$(ECHOREDIR) Compiled > $(FPCMADE)
 fpc_all: $(FPCMADE)
 fpc_all: $(FPCMADE)
@@ -1907,38 +1867,6 @@ vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
 vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
-.PHONY: fpc_shared
-override INSTALLTARGET+=fpc_shared_install
-ifndef SHARED_LIBVERSION
-SHARED_LIBVERSION=$(FPC_VERSION)
-endif
-ifndef SHARED_LIBNAME
-SHARED_LIBNAME=$(PACKAGE_NAME)
-endif
-ifndef SHARED_FULLNAME
-SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
-endif
-ifndef SHARED_LIBUNITS
-SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
-override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
-endif
-fpc_shared:
-ifdef HASSHAREDLIB
-	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
-ifneq ($(SHARED_BUILD),n)
-	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
-endif
-else
-	@$(ECHO) Shared Libraries not supported
-endif
-fpc_shared_install:
-ifneq ($(SHARED_BUILD),n)
-ifneq ($(SHARED_LIBUNITS),)
-ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
-	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
-endif
-endif
-endif
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 .PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
 ifdef INSTALL_UNITS
 ifdef INSTALL_UNITS
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
 override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
@@ -2369,9 +2297,6 @@ endif
 ifeq ($(FULL_TARGET),arm-linux)
 ifeq ($(FULL_TARGET),arm-linux)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 endif
 endif
-ifeq ($(FULL_TARGET),arm-palmos)
-TARGET_DIRS_COMPILER=1
-endif
 ifeq ($(FULL_TARGET),arm-wince)
 ifeq ($(FULL_TARGET),arm-wince)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 endif
 endif
@@ -2428,7 +2353,7 @@ smart: fpc_smart
 release: fpc_release
 release: fpc_release
 units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
 units: fpc_units $(addsuffix _units,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
 examples: $(addsuffix _examples,$(TARGET_DIRS))
-shared: fpc_shared
+shared: $(addsuffix _shared,$(TARGET_DIRS))
 sourceinstall: fpc_sourceinstall
 sourceinstall: fpc_sourceinstall
 exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))
 exampleinstall: fpc_exampleinstall $(addsuffix _exampleinstall,$(TARGET_DIRS))
 distinstall: fpc_distinstall
 distinstall: fpc_distinstall
@@ -2483,6 +2408,7 @@ buildfp:
 	$(MAKE) fpc_all
 	$(MAKE) fpc_all
 	$(MAKE) postgdbinfo
 	$(MAKE) postgdbinfo
 gdb:
 gdb:
+	$(MAKE) -C ../packages/base/gdbint
 	$(MAKE) buildfp
 	$(MAKE) buildfp
 nogdb:
 nogdb:
 	$(MAKE) buildfp NOGDB=1
 	$(MAKE) buildfp NOGDB=1

+ 1 - 0
ide/Makefile.fpc

@@ -141,6 +141,7 @@ buildfp:
         $(MAKE) postgdbinfo
         $(MAKE) postgdbinfo
 
 
 gdb:
 gdb:
+        $(MAKE) -C ../packages/base/gdbint
         $(MAKE) buildfp
         $(MAKE) buildfp
 
 
 nogdb:
 nogdb:

+ 10 - 3
ide/fp.pas

@@ -206,7 +206,7 @@ begin
   end;
   end;
   if ErrS<>'' then
   if ErrS<>'' then
   begin
   begin
-    if Assigned(Application) then
+    if (application<>nil) and (ideapp.displaymode=dmIDE) then
       ErrorBox('Stream error: '+#13+ErrS,nil)
       ErrorBox('Stream error: '+#13+ErrS,nil)
     else
     else
 
 
@@ -408,7 +408,7 @@ BEGIN
             { If ExitProc=@InterceptExit then
             { If ExitProc=@InterceptExit then
               ExitProc:=StoreExitProc;}
               ExitProc:=StoreExitProc;}
             Str(SeenExitCode,ErrS);
             Str(SeenExitCode,ErrS);
-            if Assigned(Application) then
+            if (application<>nil) and (ideapp.displaymode=dmIDE) then
               begin
               begin
                 P.l1:=SeenExitCode;
                 P.l1:=SeenExitCode;
                 ErrS:=hexstr(longint(SeenErrorAddr),8);
                 ErrS:=hexstr(longint(SeenErrorAddr),8);
@@ -423,7 +423,7 @@ BEGIN
           begin
           begin
             Str(SetJmpRes,ErrS);
             Str(SetJmpRes,ErrS);
           { Longjmp was called by fpcatch }
           { Longjmp was called by fpcatch }
-            if Assigned(Application) then
+            if (application<>nil) and (ideapp.displaymode=dmIDE) then
               begin
               begin
                 P.l1:=SetJmpRes;
                 P.l1:=SetJmpRes;
                 if OKCancelBox(error_programexitedwithsignal,@P)=cmCancel then
                 if OKCancelBox(error_programexitedwithsignal,@P)=cmCancel then
@@ -432,7 +432,14 @@ BEGIN
             else
             else
               writeln('Signal error: ',ErrS);
               writeln('Signal error: ',ErrS);
           end;
           end;
+        if ideapp.displaymode=dmUser then
+          begin
+            writeln('Fatal exception occured while in user screen mode. File save message boxes');
+            writeln('cannot be displayed. We are sorry, but need to terminate now.');
+            halt(255);
+          end;
       end;
       end;
+
     if (AutoSaveOptions and asEditorFiles)=0 then
     if (AutoSaveOptions and asEditorFiles)=0 then
       CanExit:=IDEApp.AskSaveAll
       CanExit:=IDEApp.AskSaveAll
     else
     else

+ 1 - 1
ide/fpdebug.pas

@@ -209,9 +209,9 @@ type
       procedure Force_new_value;
       procedure Force_new_value;
       destructor done;virtual;
       destructor done;virtual;
       expr : pstring;
       expr : pstring;
+      last_value,current_value : pchar;
     private
     private
       GDBRunCount : longint;
       GDBRunCount : longint;
-      last_value,current_value : pchar;
     end;
     end;
 
 
     PWatchesCollection = ^TWatchesCollection;
     PWatchesCollection = ^TWatchesCollection;

+ 89 - 0
ide/fpevalw.pas

@@ -0,0 +1,89 @@
+unit fpevalw;
+
+{****************************************************************************}
+                                  interface
+{****************************************************************************}
+
+uses fpdebug,dialogs,views,objects,fpconst,drivers;
+
+type  Pevaluate_dialog=^Tevaluate_dialog;
+      Tevaluate_dialog=object(Tdialog)
+        watch:Pwatch;
+        expr_input,expr_output:Pinputline;
+        constructor init(var bounds:Trect);
+        procedure evaluate;
+        procedure handleevent(var event:Tevent);virtual;
+        destructor done;
+      end;
+
+{****************************************************************************}
+                                implementation
+{****************************************************************************}
+
+constructor Tevaluate_dialog.init(var bounds:Trect);
+
+var r:Trect;
+    l:Plabel;
+    b:Pbutton;
+
+begin
+  inherited init(bounds,'Evaluate expression');
+  options:=options or ofcentered;
+  {watch is auto initialized to nil.}
+
+  r.assign(2,3,size.x-20,4);
+  new(expr_input,init(r,255));
+  insert(expr_input);
+
+  r.assign(2,2,size.x-20,3);
+  new(l,init(r,'E~x~pression:',expr_input));
+  insert(l);
+
+  r.assign(2,6,size.x-20,7);
+  new(expr_output,init(r,255));
+  insert(expr_output);
+
+  r.assign(2,5,size.x-20,6);
+  new(l,init(r,'~R~esult:',expr_output));
+  insert(l);
+
+  r.assign(size.x-14,3,size.x-3,5);
+  new(b,init(r,'~E~valuate',cmEvaluate,bfDefault));
+  insert(b);
+
+  r.assign(size.x-14,6,size.x-3,8);
+  new(b,init(r,'Help',cmHelp,bfNormal));
+  insert(b);
+
+  expr_input^.select;
+end;
+
+procedure Tevaluate_dialog.evaluate;
+
+begin
+  if watch<>nil then
+    dispose(watch,done);
+  new(watch,init(expr_input^.data^));
+  expr_output^.data^:=strpas(watch^.current_value);
+  expr_output^.drawview;
+end;
+
+procedure Tevaluate_dialog.handleevent(var event:Tevent);
+
+begin
+  inherited handleevent(event);
+  if event.what=evCommand then
+    case event.command of
+      cmEvaluate:
+        evaluate;
+    end;
+end;
+
+destructor Tevaluate_dialog.done;
+
+begin
+  if watch<>nil then
+    dispose(watch,done);
+end;
+
+end.

+ 16 - 2
ide/fpide.pas

@@ -22,13 +22,18 @@ uses
   WEditor,WCEdit,
   WEditor,WCEdit,
   Comphook,Browcol,
   Comphook,Browcol,
   WHTMLScn,
   WHTMLScn,
-  FPViews,FPSymbol,fpstring;
+  FPViews,FPSymbol,fpstring
+  {$ifndef NODEBUG}
+  ,fpevalw
+  {$endif};
 
 
 type
 type
     TExecType = (exNormal,exNoSwap,exDosShell);
     TExecType = (exNormal,exNoSwap,exDosShell);
+    Tdisplaymode = (dmIDE,dmUser);
 
 
     TIDEApp = object(TApplication)
     TIDEApp = object(TApplication)
       IsRunning : boolean;
       IsRunning : boolean;
+      displaymode : Tdisplaymode;
       constructor Init;
       constructor Init;
       procedure   InitDesktop; virtual;
       procedure   InitDesktop; virtual;
       procedure   LoadMenuBar;
       procedure   LoadMenuBar;
@@ -90,6 +95,7 @@ type
       procedure DoShowBreakpointList;
       procedure DoShowBreakpointList;
       procedure DoShowWatches;
       procedure DoShowWatches;
       procedure DoAddWatch;
       procedure DoAddWatch;
+      procedure do_evaluate;
       procedure DoShowRegisters;
       procedure DoShowRegisters;
       procedure DoShowFPU;
       procedure DoShowFPU;
       procedure DoShowVector;
       procedure DoShowVector;
@@ -263,6 +269,7 @@ end;
 constructor TIDEApp.Init;
 constructor TIDEApp.Init;
 var R: TRect;
 var R: TRect;
 begin
 begin
+  displaymode:=dmIDE;
   UseSyntaxHighlight:=@IDEUseSyntaxHighlight;
   UseSyntaxHighlight:=@IDEUseSyntaxHighlight;
   UseTabsPattern:=@IDEUseTabsPattern;
   UseTabsPattern:=@IDEUseTabsPattern;
   inherited Init;
   inherited Init;
@@ -401,6 +408,7 @@ begin
       NewItem(menu_debug_watches,'', kbNoKey, cmWatches, hcWatchesWindow,
       NewItem(menu_debug_watches,'', kbNoKey, cmWatches, hcWatchesWindow,
       NewItem(menu_debug_breakpoint,menu_key_debug_breakpoint, kbCtrlF8, cmToggleBreakpoint, hcToggleBreakpoint,
       NewItem(menu_debug_breakpoint,menu_key_debug_breakpoint, kbCtrlF8, cmToggleBreakpoint, hcToggleBreakpoint,
       NewItem(menu_debug_breakpointlist,'', kbNoKey, cmBreakpointList, hcBreakpointList,
       NewItem(menu_debug_breakpointlist,'', kbNoKey, cmBreakpointList, hcBreakpointList,
+      NewItem('~E~valuate...','Ctrl+F4', kbCtrlF4, cmEvaluate, hcEvaluate,
       NewItem(menu_debug_callstack,menu_key_debug_callstack, kbCtrlF3, cmStack, hcStackWindow,
       NewItem(menu_debug_callstack,menu_key_debug_callstack, kbCtrlF3, cmStack, hcStackWindow,
       NewLine(
       NewLine(
       NewItem(menu_debug_disassemble,'', kbNoKey, cmDisassemble, hcStackWindow,
       NewItem(menu_debug_disassemble,'', kbNoKey, cmDisassemble, hcStackWindow,
@@ -413,7 +421,7 @@ begin
 {$ifdef SUPPORT_REMOTE}
 {$ifdef SUPPORT_REMOTE}
       )
       )
 {$endif SUPPORT_REMOTE}
 {$endif SUPPORT_REMOTE}
-      )))))))))))))))),
+      ))))))))))))))))),
     NewSubMenu(menu_tools, hcToolsMenu, NewMenu(
     NewSubMenu(menu_tools, hcToolsMenu, NewMenu(
       NewItem(menu_tools_messages,menu_key_tools_messages, kbF11, cmToolsMessages, hcToolsMessages,
       NewItem(menu_tools_messages,menu_key_tools_messages, kbF11, cmToolsMessages, hcToolsMessages,
       NewItem(menu_tools_msgnext,menu_key_tools_msgnext, kbAltF8, cmToolsMsgNext, hcToolsMsgNext,
       NewItem(menu_tools_msgnext,menu_key_tools_msgnext, kbAltF8, cmToolsMsgNext, hcToolsMsgNext,
@@ -762,6 +770,7 @@ begin
              cmRegisters     : DoShowRegisters;
              cmRegisters     : DoShowRegisters;
              cmFPURegisters     : DoShowFPU;
              cmFPURegisters     : DoShowFPU;
              cmVectorRegisters : DoShowVector;
              cmVectorRegisters : DoShowVector;
+             cmEvaluate      : do_evaluate;
            { -- Options menu -- }
            { -- Options menu -- }
              cmSwitchesMode  : SetSwitchesMode;
              cmSwitchesMode  : SetSwitchesMode;
              cmCompiler      : DoCompilerSwitch;
              cmCompiler      : DoCompilerSwitch;
@@ -879,6 +888,7 @@ end;
 
 
 procedure TIDEApp.ShowUserScreen;
 procedure TIDEApp.ShowUserScreen;
 begin
 begin
+  displaymode:=dmUser;
   if Assigned(UserScreen) then
   if Assigned(UserScreen) then
     UserScreen^.SaveIDEScreen;
     UserScreen^.SaveIDEScreen;
   DoneSysError;
   DoneSysError;
@@ -913,6 +923,9 @@ begin
 {$ifndef go32v2}
 {$ifndef go32v2}
   initvideo;
   initvideo;
 {$endif ndef go32v2}
 {$endif ndef go32v2}
+  {Videobuffer has been reallocated, need passive video situation detection
+   again.}
+  initscreen;
 {$ifdef Windows}
 {$ifdef Windows}
   { write the empty screen to dummy console handle }
   { write the empty screen to dummy console handle }
   UpdateScreen(true);
   UpdateScreen(true);
@@ -942,6 +955,7 @@ begin
   UpdateScreen(true);
   UpdateScreen(true);
 {$endif go32v2}
 {$endif go32v2}
 {$endif Windows}
 {$endif Windows}
+  displaymode:=dmIDE;
 end;
 end;
 
 
 function TIDEApp.AutoSave: boolean;
 function TIDEApp.AutoSave: boolean;

+ 22 - 0
ide/fpmdebug.inc

@@ -255,3 +255,25 @@ begin
 end;
 end;
 {$endif NODEBUG}
 {$endif NODEBUG}
 
 
+{$ifdef NODEBUG}
+procedure TIDEapp.do_evaluate;
+
+begin
+  nodebugger;
+end;
+{$else}
+procedure TIDEapp.do_evaluate;
+
+var d:Pevaluate_dialog;
+    r:Trect;
+
+begin
+  desktop^.getextent(r);
+  r.b.x:=r.b.x*3 div 4;
+  r.b.y:=12;
+  new(d,init(r));
+  desktop^.execview(d);
+  dispose(d,done);
+end;
+{$endif}
+

+ 3 - 2
ide/fpredir.pas

@@ -940,10 +940,11 @@ end;
   SmallHeap;
   SmallHeap;
 {$EndIf MsDos}
 {$EndIf MsDos}
     SwapVectors;
     SwapVectors;
-    { Must use shell() for linux for the wildcard expansion (PFV) }
 {$ifdef UNIX}
 {$ifdef UNIX}
     IOStatus:=0;
     IOStatus:=0;
-    ExecuteResult:=Shell(MaybeQuoted(FixPath(Progname))+' '+Comline);
+    {We need to use fpsystem to get wildcard expansion and avoid being
+     interrupted by ctrl+c (SIGINT).};
+    ExecuteResult:=fpsystem(MaybeQuoted(FixPath(Progname))+' '+Comline);
     if ExecuteResult<0 then
     if ExecuteResult<0 then
       begin
       begin
         IOStatus:=(-ExecuteResult) and $7f;
         IOStatus:=(-ExecuteResult) and $7f;