Browse Source

* always include DebugMessage definitionwutils.pas

git-svn-id: trunk@6117 -
pierre 18 years ago
parent
commit
f876187194
13 changed files with 198 additions and 117 deletions
  1. 1 35
      ide/compiler/Makefile
  2. 56 56
      ide/cvsdiff.tdf
  3. 19 2
      ide/fpcatch.pas
  4. 15 4
      ide/fpcompil.pas
  5. 3 2
      ide/fpcygwin.pas
  6. 1 1
      ide/fpide.pas
  7. 7 4
      ide/fpredir.pas
  8. 58 3
      ide/fpusrscr.pas
  9. 2 2
      ide/globdir.inc
  10. 16 0
      ide/test.pas
  11. 16 3
      ide/wconsole.pas
  12. 2 1
      ide/whtmlhlp.pas
  13. 2 4
      ide/wutils.pas

+ 1 - 35
ide/compiler/Makefile

@@ -2,7 +2,7 @@
 # Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/01/18]
 # Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/01/18]
 #
 #
 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-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-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-embedded
+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 i386-embedded 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-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded powerpc64-linux powerpc64-embedded
 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
@@ -306,9 +306,6 @@ endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=compunit
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
@@ -396,9 +393,6 @@ endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=compunit
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
@@ -460,9 +454,6 @@ endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_OPTIONS+=-Ur -dNOCATCH
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
@@ -550,9 +541,6 @@ endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_OPTIONS+=-Ur -dNOCATCH
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
@@ -613,9 +601,6 @@ endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 endif
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 endif
 endif
@@ -703,9 +688,6 @@ endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 endif
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET)
 endif
 endif
@@ -766,9 +748,6 @@ endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
@@ -856,9 +835,6 @@ endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(CPU_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
@@ -1191,10 +1167,6 @@ EXEEXT=.gba
 SHAREDLIBEXT=.so
 SHAREDLIBEXT=.so
 SHORTSUFFIX=gba
 SHORTSUFFIX=gba
 endif
 endif
-ifeq ($(OS_TARGET),symbian)
-SHAREDLIBEXT=.dll
-SHORTSUFFIX=symbian
-endif
 else
 else
 ifeq ($(OS_TARGET),go32v1)
 ifeq ($(OS_TARGET),go32v1)
 PPUEXT=.pp1
 PPUEXT=.pp1
@@ -1667,9 +1639,6 @@ endif
 ifeq ($(FULL_TARGET),i386-embedded)
 ifeq ($(FULL_TARGET),i386-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
-ifeq ($(FULL_TARGET),i386-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
 ifeq ($(FULL_TARGET),m68k-linux)
 ifeq ($(FULL_TARGET),m68k-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -1757,9 +1726,6 @@ endif
 ifeq ($(FULL_TARGET),arm-embedded)
 ifeq ($(FULL_TARGET),arm-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
-ifeq ($(FULL_TARGET),arm-symbian)
-REQUIRE_PACKAGES_RTL=1
-endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 56 - 56
ide/cvsdiff.tdf

@@ -1,56 +1,56 @@
-[Main]
-Title="CVS Commit"
-Size=(56,15)
-CommandLine="diff %c% %revision% %filename%"
-Default="filename"
-
-[filename]
-Type=InputLine
-Origin=(2,3)
-Size=(52,1)
-Value=$EDNAME
-
-[label1]
-Type=Label
-Origin=(2,2)
-Size=(52,1)
-Text="~F~ile(s) to diff"
-Link="filename"
-
-[revision]
-Type=InputLine
-Origin=(2,5)
-Size=(52,1)
-Value=
-
-[label2]
-Type=Label
-Origin=(2,4)
-Size=(52,1)
-Text="to specific ~r~evision"
-Link="revision"
-
-[c]
-Type=CheckBox
-Name="~C~ontext diff"
-Origin=(2,6)
-Size=(25,1)
-Default=On
-On="-c"
-
-[b]
-Type=CheckBox
-Name="~I~gnore blank changes"
-Origin=(2,7)
-Size=(25,1)
-Default=On
-On="-b"
-
-[u]
-Type=CheckBox
-Name="~U~nified diff"
-Origin=(2,8)
-Size=(25,1)
-Default=Off
-On="-u"
-
+[Main]
+Title="CVS Diff"
+Size=(56,15)
+CommandLine="diff %c% %revision% %filename%"
+Default="filename"
+
+[filename]
+Type=InputLine
+Origin=(2,3)
+Size=(52,1)
+Value=$EDNAME
+
+[label1]
+Type=Label
+Origin=(2,2)
+Size=(52,1)
+Text="~F~ile(s) to diff"
+Link="filename"
+
+[revision]
+Type=InputLine
+Origin=(2,5)
+Size=(52,1)
+Value=
+
+[label2]
+Type=Label
+Origin=(2,4)
+Size=(52,1)
+Text="to specific ~r~evision"
+Link="revision"
+
+[c]
+Type=CheckBox
+Name="~C~ontext diff"
+Origin=(2,6)
+Size=(25,1)
+Default=On
+On="-c"
+
+[b]
+Type=CheckBox
+Name="~I~gnore blank changes"
+Origin=(2,7)
+Size=(25,1)
+Default=On
+On="-b"
+
+[u]
+Type=CheckBox
+Name="~U~nified diff"
+Origin=(2,8)
+Size=(25,1)
+Default=Off
+On="-u"
+

+ 19 - 2
ide/fpcatch.pas

@@ -224,10 +224,27 @@ begin
     exit;
     exit;
 {$ifdef Windows}
 {$ifdef Windows}
   if GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @Mode) then
   if GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @Mode) then
-    SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), (Mode or ENABLE_MOUSE_INPUT) and not ENABLE_PROCESSED_INPUT);
+    begin
+{$ifdef DEBUG}
+      Writeln(stderr,'Starting value of ConsoleMode is $',hexstr(Mode,8));
+{$endif DEBUG}
+      SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)),
+        (Mode or ENABLE_MOUSE_INPUT) and not ENABLE_PROCESSED_INPUT);
+{$ifdef DEBUG}
+    end
+  else
+    begin
+      Writeln(stderr,'Call to GetConsoleMode failed, GetLastError=',
+        GetLastError);
+{$endif DEBUG}
+    end;
 {$endif Windows}
 {$endif Windows}
 {$ifdef go32v2}
 {$ifdef go32v2}
-  djgpp_set_ctrl_c(false);
+  {
+    I think that it was an error to put that here PM
+    djgpp_set_ctrl_c(false);
+    at least since that this is now handled in fpusrscr.pas unit
+  }
 {$endif go32v2}
 {$endif go32v2}
 {$ifdef HasSignal}
 {$ifdef HasSignal}
 {$ifndef TP}
 {$ifndef TP}

+ 15 - 4
ide/fpcompil.pas

@@ -220,7 +220,8 @@ const
 
 
 procedure ParseUserScreen;
 procedure ParseUserScreen;
 var
 var
-  y : longint;
+  Y,YMax : longint;
+  LEvent : TEvent;
   Text,Attr : String;
   Text,Attr : String;
   DisplayCompilerWindow : boolean;
   DisplayCompilerWindow : boolean;
   cc: integer;
   cc: integer;
@@ -232,7 +233,7 @@ var
         if pos('  $',Text)=1 then
         if pos('  $',Text)=1 then
           begin
           begin
             AText:=Text;
             AText:=Text;
-            Delete(Text,1,10);
+            Delete(Text,1,11);
             While pos(' ',Text)=1 do
             While pos(' ',Text)=1 do
               Delete(Text,1,1);
               Delete(Text,1,1);
             if pos('of ',Text)>0 then
             if pos('of ',Text)>0 then
@@ -251,7 +252,7 @@ var
               end
               end
             else
             else
               row:=0;
               row:=0;
-            CompilerMessageWindow^.AddMessage(V_Fatal,AText
+            CompilerMessageWindow^.AddMessage(V_Fatal or v_lineinfo,AText
                   ,ModuleName,row,1);
                   ,ModuleName,row,1);
             DisplayCompilerWindow:=true;
             DisplayCompilerWindow:=true;
           end;
           end;
@@ -282,11 +283,21 @@ begin
   if not assigned(UserScreen) then
   if not assigned(UserScreen) then
     exit;
     exit;
   DisplayCompilerWindow:=false;
   DisplayCompilerWindow:=false;
+  YMax:=UserScreen^.GetHeight;
   PushStatus('Parsing User Screen');
   PushStatus('Parsing User Screen');
   CompilerMessageWindow^.Lock;
   CompilerMessageWindow^.Lock;
-  for Y:=0 to UserScreen^.GetHeight do
+  for Y:=0 to YMax do
     begin
     begin
       UserScreen^.GetLine(Y,Text,Attr);
       UserScreen^.GetLine(Y,Text,Attr);
+      if (y mod 10) = 0 then
+        begin
+          CompilerMessageWindow^.Unlock;
+          SetStatus('Parsing User Screen line '+IntToStr(y)+'/'+IntToStr(YMax));
+          CompilerMessageWindow^.Lock;
+        end;
+      GetKeyEvent(LEvent);
+      if (LEvent.What=evKeyDown) and (LEvent.KeyCode=kbEsc) then
+        break;
       SearchBackTrace;
       SearchBackTrace;
       InsertInMessages(' Fatal:',v_Fatal or v_lineinfo,true);
       InsertInMessages(' Fatal:',v_Fatal or v_lineinfo,true);
       InsertInMessages(' Error:',v_Error or v_lineinfo,true);
       InsertInMessages(' Error:',v_Error or v_lineinfo,true);

+ 3 - 2
ide/fpcygwin.pas

@@ -67,7 +67,7 @@ begin
     GetCygwinFullName:='cygwin1.dll';
     GetCygwinFullName:='cygwin1.dll';
 end;
 end;
 
 
-begin
+initialization
   ModuleH:=GetModuleHandle('cygwin1');
   ModuleH:=GetModuleHandle('cygwin1');
   GetMem(CygwinFullName,MAX_PATH+1);
   GetMem(CygwinFullName,MAX_PATH+1);
   GetModuleFileName(ModuleH,CygwinFullName,MAX_PATH+1);
   GetModuleFileName(ModuleH,CygwinFullName,MAX_PATH+1);
@@ -81,5 +81,6 @@ begin
         FileInfo:=PFileInfo^;
         FileInfo:=PFileInfo^;
     end;
     end;
   FreeMem(InfoData,size);
   FreeMem(InfoData,size);
-  {FreeMem(CygwinFullName,MAX_PATH+1);}
+finalization
+  FreeMem(CygwinFullName,MAX_PATH+1);
 end.
 end.

+ 1 - 1
ide/fpide.pas

@@ -1326,7 +1326,7 @@ begin
              cmHelpContents  : HelpContents;
              cmHelpContents  : HelpContents;
              cmHelpIndex     : HelpHelpIndex;
              cmHelpIndex     : HelpHelpIndex;
              cmHelpDebug     : HelpDebugInfos;
              cmHelpDebug     : HelpDebugInfos;
-{             cmHelpTopicSearch: HelpTopicSearch;}
+             cmHelpTopicSearch: HelpTopicSearch;
              cmHelpPrevTopic : HelpPrevTopic;
              cmHelpPrevTopic : HelpPrevTopic;
              cmHelpUsingHelp : HelpUsingHelp;
              cmHelpUsingHelp : HelpUsingHelp;
              cmHelpFiles     : HelpFiles;
              cmHelpFiles     : HelpFiles;

+ 7 - 4
ide/fpredir.pas

@@ -695,9 +695,12 @@ end;
 function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
 function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
 {$ifdef Windows}
 {$ifdef Windows}
 var
 var
-  mode : word;
+  mode,modebefore : word;
 {$endif Windows}
 {$endif Windows}
 Begin
 Begin
+{$ifdef Windows}
+  GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @modebefore);
+{$endif Windows}
   RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
   RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
   ExecuteResult:=0;
   ExecuteResult:=0;
   IOStatus:=0;
   IOStatus:=0;
@@ -715,10 +718,10 @@ Begin
                 (RedirErrorIn=0) and (RedirErrorError=0) and
                 (RedirErrorIn=0) and (RedirErrorError=0) and
                 (ExecuteResult=0);
                 (ExecuteResult=0);
 {$ifdef Windows}
 {$ifdef Windows}
-  // reenable mouse events
+  // restore previous mode
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode);
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode);
-  mode:=mode or ENABLE_MOUSE_INPUT;
-  SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), mode);
+  //mode:=mode or ENABLE_MOUSE_INPUT;
+  SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), modebefore);
 {$endif Windows}
 {$endif Windows}
 End;
 End;
 
 

+ 58 - 3
ide/fpusrscr.pas

@@ -222,6 +222,10 @@ type
       ConsoleMode,IdeMode      : Dword;
       ConsoleMode,IdeMode      : Dword;
       IdeScreenMode : TVideoMode;
       IdeScreenMode : TVideoMode;
       procedure BufferCopy(src,dest : THandle);
       procedure BufferCopy(src,dest : THandle);
+{$ifdef debug}
+      procedure Complain(St : string);
+      Procedure SetConsoleMode(FH : Handle;Mode : DWord);
+{$endif debug}
     end;
     end;
 {$endif}
 {$endif}
 
 
@@ -982,8 +986,12 @@ end;
 
 
 { Seems to be missing in windows unit PM }
 { Seems to be missing in windows unit PM }
 const
 const
-  ENABLE_INSERT_MODE = $20;
+  ENABLE_INSERT_MODE     = $20;
   ENABLE_QUICK_EDIT_MODE = $40;
   ENABLE_QUICK_EDIT_MODE = $40;
+  ENABLE_EXTENDED_FLAGS  = $80;
+  ENABLE_AUTO_POSITION   = $100;
+
+
 
 
 procedure UpdateFileHandles;
 procedure UpdateFileHandles;
 begin
 begin
@@ -1021,6 +1029,7 @@ begin
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
   IdeMode:=ConsoleMode;
   IdeMode:=ConsoleMode;
 {$ifdef debug}
 {$ifdef debug}
+  Complain('Starting ConsoleMode is $'+hexstr(ConsoleMode,8));
 {define Windowsbigwin}
 {define Windowsbigwin}
 {$endif debug}
 {$endif debug}
 {$ifdef Windowsbigwin}
 {$ifdef Windowsbigwin}
@@ -1265,9 +1274,17 @@ end;
 { dummy for Windows as the Buffer screen
 { dummy for Windows as the Buffer screen
   do hold all the info }
   do hold all the info }
 procedure TWindowsScreen.SaveIDEScreen;
 procedure TWindowsScreen.SaveIDEScreen;
+var
+  NowIdeMode : Dword;
 begin
 begin
   IdeScreenMode:=ScreenMode;
   IdeScreenMode:=ScreenMode;
-  GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @IdeMode);
+  GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @NowIdeMode);
+{$ifdef debug}
+  Complain('IDE ConsoleMode is $'+hexstr(NowIdeMode,8));
+  if NowIdeMode<>IdeMode then
+    Complain('is not equal to IDEMode  $'+hexstr(IdeMode,8));
+{$endif debug}
+  IdeMode:=NowIdeMode;
   { set the dummy buffer as active already now PM }
   { set the dummy buffer as active already now PM }
   SetStdHandle(cardinal(Std_Output_Handle),DummyScreenBufferHandle);
   SetStdHandle(cardinal(Std_Output_Handle),DummyScreenBufferHandle);
   UpdateFileHandles;
   UpdateFileHandles;
@@ -1278,6 +1295,9 @@ end;
 procedure TWindowsScreen.SaveConsoleScreen;
 procedure TWindowsScreen.SaveConsoleScreen;
 begin
 begin
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
+{$ifdef debug}
+  Complain('ConsoleMode now is $'+hexstr(ConsoleMode,8));
+{$endif debug}
   { set the dummy buffer as active already now PM }
   { set the dummy buffer as active already now PM }
   SetStdHandle(cardinal(Std_Output_Handle),DummyScreenBufferHandle);
   SetStdHandle(cardinal(Std_Output_Handle),DummyScreenBufferHandle);
   UpdateFileHandles;
   UpdateFileHandles;
@@ -1307,7 +1327,9 @@ begin
   { Needed to force InitSystemMsg to use the right console handle }
   { Needed to force InitSystemMsg to use the right console handle }
   DoneEvents;
   DoneEvents;
   InitEvents;
   InitEvents;
-  IdeMode:=(IdeMode or ENABLE_MOUSE_INPUT or ENABLE_WINDOW_INPUT)
+  IdeMode:=({IdeMode or }ENABLE_MOUSE_INPUT or
+                   ENABLE_WINDOW_INPUT or
+                   ENABLE_EXTENDED_FLAGS)
            and not (ENABLE_PROCESSED_INPUT or
            and not (ENABLE_PROCESSED_INPUT or
                     ENABLE_LINE_INPUT or
                     ENABLE_LINE_INPUT or
                     ENABLE_ECHO_INPUT or
                     ENABLE_ECHO_INPUT or
@@ -1340,6 +1362,39 @@ begin
   IDEActive:=true;
   IDEActive:=true;
 end;
 end;
 
 
+{$ifdef debug}
+
+procedure TWindowsScreen.Complain(St : string);
+begin
+  if IDEActive then
+    DebugMessage('',St,0,0)
+  else
+    Writeln(stderr,St);
+end;
+
+procedure TWindowsScreen.SetConsoleMode(FH : Handle;Mode: DWord);
+var
+  Test: DWord;
+begin
+  If not Windows.SetConsoleMode(FH,Mode) then
+    begin
+      Complain('SetConsoleMode call failed GetLastError='+IntToStr(GetLastError));
+    end
+  else
+    begin
+      if not GetConsoleMode(FH,Test) then
+        begin
+          Complain('GetConsoleMode call failed GetLastError='+IntToStr(GetLastError));
+        end
+      else if (Test<>Mode) then
+        begin
+          Complain('GetConsoleMode result '+IntToStr(Test)+' <> '+
+            IntToStr(Mode));
+        end;
+    end;
+end;
+{$endif DEBUG}
+
 {$endif}
 {$endif}
 
 
 {****************************************************************************
 {****************************************************************************

+ 2 - 2
ide/globdir.inc

@@ -32,9 +32,9 @@
   {$define HasSignal}
   {$define HasSignal}
   {$define FSCaseInsensitive}
   {$define FSCaseInsensitive}
   {$define HasSysMsgUnit}
   {$define HasSysMsgUnit}
-  {$ifdef DEBUG}
+  {$ifdef EXTDEBUG}
     {$define USE_GRAPH_SWITCH}
     {$define USE_GRAPH_SWITCH}
-  {$endif DEBUG}
+  {$endif EXTDEBUG}
 {$endif}
 {$endif}
 
 
 {$ifdef Linux}
 {$ifdef Linux}

+ 16 - 0
ide/test.pas

@@ -88,6 +88,7 @@ var Hello : word;
     Pointer2: PObj;
     Pointer2: PObj;
     ClassVar1: TClass;
     ClassVar1: TClass;
     ClassVar2: TClass2;
     ClassVar2: TClass2;
+    ClassClass: Class of TObject;
     Obj1: TObj;
     Obj1: TObj;
     Obj2: TObj2;
     Obj2: TObj2;
     CharArray : Array[1..2000] of char;
     CharArray : Array[1..2000] of char;
@@ -130,6 +131,17 @@ begin
   X:=7;
   X:=7;
 end;
 end;
 
 
+procedure TestOverload;
+begin
+  Writeln('Procedure without argument called');
+end;
+
+procedure TestOverload(arg : string);
+begin
+  Writeln('Procedure with one argument called');
+  Writeln('argument is ',arg);
+end;
+
 function Func1(x,z : word; var y : boolean; const r: TRecord): shortint;
 function Func1(x,z : word; var y : boolean; const r: TRecord): shortint;
 
 
 var loc : string;
 var loc : string;
@@ -181,6 +193,8 @@ BEGIN
       SingleArrayArray[i,j]:=i*j;
       SingleArrayArray[i,j]:=i*j;
 
 
   ClassVar1:=TClass2.create;
   ClassVar1:=TClass2.create;
+
+  ClassClass:=TClass2.ClassType;
   Obj1.Init;
   Obj1.Init;
   pointer2:=@Obj1;
   pointer2:=@Obj1;
   Writeln('Obj1.Z=',Obj1.Z);
   Writeln('Obj1.Z=',Obj1.Z);
@@ -193,6 +207,8 @@ BEGIN
   Writeln('ParamCount = ',ParamCount);
   Writeln('ParamCount = ',ParamCount);
   For i:=0 to paramcount do
   For i:=0 to paramcount do
    writeln('Paramstr(',i,') = '+Paramstr(i));
    writeln('Paramstr(',i,') = '+Paramstr(i));
+  TestOverload;
+  TestOverload('Test');
   writeln(IsOdd(3));
   writeln(IsOdd(3));
   writeln(Func1(5,5,Bool,T));
   writeln(Func1(5,5,Bool,T));
   new(X);
   new(X);

+ 16 - 3
ide/wconsole.pas

@@ -48,8 +48,13 @@ Procedure RestoreConsoleMode(const ConsoleMode : TConsoleMode);
 implementation
 implementation
 {$ifdef Windows}
 {$ifdef Windows}
   uses
   uses
+    wutils,
     windows;
     windows;
 {$endif Windows}
 {$endif Windows}
+{$ifdef GO32V2}
+  uses
+    Dpmiexcp;
+{$endif GO32V2}
 
 
 Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
 Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
 Begin
 Begin
@@ -57,10 +62,15 @@ Begin
   TCGetAttr(1,ConsoleMode);
   TCGetAttr(1,ConsoleMode);
 {$endif UNIX}
 {$endif UNIX}
 {$ifdef Windows}
 {$ifdef Windows}
-  GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
+  if not GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode) then
+    DebugMessage('','Call to GetConsoleMode failed, GetLastError='+
+        IntToStr(GetLastError),0,0);
 {$endif Windows}
 {$endif Windows}
 {$ifdef go32v2}
 {$ifdef go32v2}
-  ConsoleMode:=0;
+  if djgpp_set_ctrl_c(false) then
+    ConsoleMode:=1
+  else
+    ConsoleMode:=0;
 {$endif go32v2}
 {$endif go32v2}
 {$ifdef netware}
 {$ifdef netware}
   ConsoleMode:=0;
   ConsoleMode:=0;
@@ -73,9 +83,12 @@ Begin
   TCSetAttr(1,TCSANOW,ConsoleMode);
   TCSetAttr(1,TCSANOW,ConsoleMode);
 {$endif UNIX}
 {$endif UNIX}
 {$ifdef Windows}
 {$ifdef Windows}
-  SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
+  if not SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode) then
+    DebugMessage('','Call to SetConsoleMode failed, GetLastError='+
+        IntToStr(GetLastError),0,0);
 {$endif Windows}
 {$endif Windows}
 {$ifdef go32v2}
 {$ifdef go32v2}
+  djgpp_set_ctrl_c((ConsoleMode and 1)<>0);
 {$endif go32v2}
 {$endif go32v2}
 End;
 End;
 
 

+ 2 - 1
ide/whtmlhlp.pas

@@ -1331,7 +1331,8 @@ begin
             DebugMessage(Name,Link+' not found',1,1);
             DebugMessage(Name,Link+' not found',1,1);
 {$endif DEBUG}
 {$endif DEBUG}
         end;
         end;
-      if HTMLFile<>nil then Dispose(HTMLFile, Done);
+      if HTMLFile<>nil then
+        Dispose(HTMLFile, Done);
       if BookMark='' then
       if BookMark='' then
         T^.StartNamedMark:=0
         T^.StartNamedMark:=0
       else
       else

+ 2 - 4
ide/wutils.pas

@@ -200,14 +200,14 @@ const LastStrToIntResult : integer = 0;
 
 
 procedure RegisterWUtils;
 procedure RegisterWUtils;
 
 
-{$ifdef DEBUG}
 Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
 Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
 type
 type
   TDebugMessage = procedure(AFileName, AText : string; ALine, APos : sw_word);
   TDebugMessage = procedure(AFileName, AText : string; ALine, APos : sw_word);
 
 
 Const
 Const
   DebugMessage : TDebugMessage = @WUtilsDebugMessage;
   DebugMessage : TDebugMessage = @WUtilsDebugMessage;
-{$endif DEBUG}
+
+
 implementation
 implementation
 
 
 uses
 uses
@@ -1350,13 +1350,11 @@ begin
 {$endif}
 {$endif}
 end;
 end;
 
 
-{$ifdef DEBUG}
 Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
 Procedure WUtilsDebugMessage(AFileName, AText : string; ALine, APos : sw_word);
 begin
 begin
   writeln(stderr,AFileName,' (',ALine,',',APos,') ',AText);
   writeln(stderr,AFileName,' (',ALine,',',APos,') ',AText);
 end;
 end;
 
 
-{$endif DEBUG}
 BEGIN
 BEGIN
   Randomize;
   Randomize;
 END.
 END.