Hi, the bug description is the following (Im working on Windows XP):
When I create a new project, I can build and debug it with no problems. -> OK.
However, when a I save the project, the debugger doesn't work anymore. No matter how simple is the code. I always get the message: Debugger Error! The Debugger entered in error state. Save your work now and hope the best. It compiles, but doesn't run.
The only workaround I found for this is to turn off the debugger. Then I can run my project.
This is probably due to many install/uninstall cycles that may have corrupted some path. However, even if I install in a different location I still get this error.
0.9.29 of aproc what age? couple of days, couple of weeks, or older?
Which version of gdb?
In the "view" menu, sub-menu "debug windows", is an entry "Debug output", please open it, and then attempt to run your app, in order to produce the error.
Please copy and attach the output from the window.
Also please check, if the path or project name you used to save contains any spaces or accented, umlauted, or none European chars. If so please try in a folder/name with plain a-z,0-9 only. (still attach the above output)
Hi, my current Lazarus build dates from 2010-12-19.
gdb version is 7.2.
If I save the project in a folder that contain no spaces, as you mentioned, everything works fine. However, earlier it used to work even if the project was located in a folder such as My Documents. In fact, this same build of Lazarus works as expected on a virtual machine running Win 7 (I can save the project in a folder containing spaces).
Here is the output of the debugger window:
------------------------------------------------------
=thread-group-added,id="i1"
(gdb)
<-gdb-set confirm off>
^done
(gdb)
<-gdb-set new-console off>
^done
(gdb)
<-gdb-version>
~"GNU gdb (GDB) 7.2\n"
~"Copyright (C) 2010 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later &LtPos;http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\n" "This GDB was configured as "mingw32".\nFor bug reporting instructions, please see:\n" "&LtPos;http://www.gnu.org/software/gdb/bugs/>.\n"
^done
(gdb)
<-gdb-version> "GNU gdb (GDB) 7.2\n" "Copyright (C) 2010 Free Software Foundation, Inc.\n" "License GPLv3+: GNU GPL version 3 or later &LtPos;http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.\n" "This GDB was configured as "mingw32".\nFor bug reporting instructions, please see:\n" "&LtPos;http://www.gnu.org/software/gdb/bugs/>.\n"
^done
(gdb)
<-gdb-set env __COMPAT_LAYER=EnableNXShowUI >
^done
(gdb)
<-gdb-set env ALLUSERSPROFILE=C:\Documents and Settings\All Users>
^done
(gdb)
<-gdb-set env APACHE2TRIAD_DIR=C:\apache2triad>
^done
(gdb)
<-gdb-set env APPDATA=C:\Documents and Settings\Administrador\Dados de aplicativos>
^done
(gdb)
<-gdb-set env CLASSPATH=.;C:\Arquivos de programas\Java\jre6\lib\ext\QTJava.zip>
^done
(gdb)
<-gdb-set env CLIENTNAME=Console>
^done
(gdb)
<-gdb-set env CommonProgramFiles=C:\Arquivos de programas\Arquivos comuns>
^done
(gdb)
<-gdb-set env COMPUTERNAME=YURI-PC>
^done
(gdb)
<-gdb-set env ComSpec=C:\WINDOWS\system32\cmd.exe>
^done
(gdb)
<-gdb-set env FP_NO_HOST_CHECK=NO>
^done
(gdb)
<-gdb-set env HOMEDRIVE=C:>
^done
(gdb)
<-gdb-set env HOMEPATH=\Documents and Settings\Administrador>
^done
(gdb)
<-gdb-set env LC_ALL=pt_BR>
^done
(gdb)
<-gdb-set env LOGONSERVER=\YURI-PC>
^done
(gdb)
<-gdb-set env NUMBER_OF_PROCESSORS=2>
^done
(gdb)
<-gdb-set env OPENSSL_CONF=C:\apache2triad\opssl\bin>
^done
(gdb)
<-gdb-set env OS=Windows_NT>
^done
(gdb)
<-gdb-set env Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\ARQUIV1\PICC;C:\Arquivos de programas\IDM Computer Solutions\UltraEdit-32;C:\Arquivos de programas\Delphi7SE\bin;C:\Arquivos de programas\Delphi7SE\Projects\BPL;C:\Program Files\HI-TECH Software\PICC\std\9.60\bin;;C:\Arquivos de programas\MATLAB\R2009b\runtime\win32;C:\Arquivos de programas\MATLAB\R2009b\bin;C:\Arquivos de programas\Microchip\MPLAB C32 Suite\bin;C:\Arquivos de programas\Microchip\MPLAB IDE\VDI;C:\apache2triad\bin;C:\apache2triad\perl\bin;C:\apache2triad\php\bin;C:\apache2triad\mysql\bin;C:\apache2triad\opssl\bin;C:\apache2triad\python\bin;C:\apache2triad\pgsql\bin;C:\Arquivos de programas\K-Lite Codec Pack\QuickTime\QTSystem;C:\Documents and Settings\All Users\Documentos\RAD Studio\7.0\Bpl>
^done
(gdb)
<-gdb-set env PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH>
^done
(gdb)
<-gdb-set env PHP_PEAR_BIN_DIR=C:\apache2triad\php\bin>
^done
(gdb)
<-gdb-set env PHP_PEAR_DATA_DIR=C:\apache2triad\php\pear\data>
^done
(gdb)
<-gdb-set env PHP_PEAR_DOC_DIR=C:\apache2triad\php\pear\docs>
^done
(gdb)
<-gdb-set env PHP_PEAR_INSTALL_DIR=C:\apache2triad\php\pear>
^done
(gdb)
<-gdb-set env PHP_PEAR_PHP_BIN=C:\apache2triad\php\bin\php-cgi.exe>
^done
(gdb)
<-gdb-set env PHP_PEAR_SYSCONF_DIR=C:\apache2triad\php>
^done
(gdb)
<-gdb-set env PHP_PEAR_TEST_DIR=C:\apache2triad\php\pear\tests>
^done
(gdb)
<-gdb-set env PPM_DAT=C:\apache2triad\perl\site\lib>
^done
(gdb)
<-gdb-set env PROCESSOR_ARCHITECTURE=x86>
^done
(gdb)
<-gdb-set env PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel>
^done
(gdb)
<-gdb-set env PROCESSOR_LEVEL=6>
^done
(gdb)
<-gdb-set env PROCESSOR_REVISION=170a>
^done
(gdb)
<-gdb-set env ProgramFiles=C:\Arquivos de programas>
^done
(gdb)
<-gdb-set env QTJAVA=C:\Arquivos de programas\Java\jre6\lib\ext\QTJava.zip>
^done
(gdb)
<-gdb-set env SESSIONNAME=Console>
^done
(gdb)
<-gdb-set env SSLEAY_CONF=C:\apache2triad\opssl\bin>
^done
(gdb)
<-gdb-set env SystemDrive=C:>
^done
(gdb)
<-gdb-set env SystemRoot=C:\WINDOWS>
^done
(gdb)
<-gdb-set env TEMP=C:\DOCUME1\ADMINI1\CONFIG1\Temp>
^done
(gdb)
<-gdb-set env TMP=C:\DOCUME1\ADMINI1\CONFIG1\Temp>
^done
(gdb)
<-gdb-set env USERDOMAIN=YURI-PC>
^done
(gdb)
<-gdb-set env USERNAME=Administrador>
^done
(gdb)
<-gdb-set env USERPROFILE=C:\Documents and Settings\Administrador>
^done
(gdb)
<-gdb-set env VBOX_INSTALL_PATH=C:\Arquivos de programas\Oracle\VirtualBox>
^done
(gdb)
<-gdb-set env windir=C:\WINDOWS>
^done
(gdb)
<-file-exec-and-symbols "C:/Documents and Settings/Administrador/Meus documentos/teste/teste.exe">
^done
(gdb)
<-environment-cd .>
^done
(gdb)
<-environment-cd "C:/Documents and Settings/Administrador/Meus documentos/teste/">
^done
(gdb)
<-data-evaluate-expression FPC_THREADVAR_RELOCATE_PROC>
^error,msg="No symbol "FPC_THREADVAR_RELOCATE_PROC" in current context."
(gdb)
&LtPos;info functions FPC_CPUINIT>
&"info functions FPC_CPUINIT\n"
~"All functions matching regular expression "FPC_CPUINIT":\n"
~"\nNon-debugging symbols:\n"
~"0x00403440 SYSTEM_FPC_CPUINIT\n"
^done
(gdb)
<-exec-arguments >
^done
(gdb)
&LtPos;set width 50000>
&"set width 50000\n"
^done
(gdb)
<-gdb-set language pascal>
^done
(gdb)
&LtPos;info address main>
&"info address main\n"
~"Symbol "main" is a function at address 0x402a50.\n"
^done
(gdb)
<-break-insert -t *4205136>
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00402a50",func="main",file="teste.lpr",fullname="C:/Documents and Settings/Administrador/Meus documentos/teste/teste.lpr",line="15",times="0",original-location="*4205136"}
(gdb)
&LtPos;ptype TObject>
&"ptype TObject\n"
~"type = TOBJECT = class \n"
~" public\n"
~" constructor CREATE (TOBJECT, POINTER) : ^TOBJECT;\n"
~" destructor ~DESTROY (TOBJECT, POINTER); virtual;\n"
~" function NEWINSTANCE (unnamedtype) : ^TOBJECT; virtual;\n"
~" procedure FREEINSTANCE (TOBJECT); virtual;\n"
~" function SAFECALLEXCEPTION (TOBJECT, TOBJECT, POINTER) : HRESULT; virtual;\n"
~" procedure DEFAULTHANDLER (TOBJECT, var); virtual;\n"
~" procedure FREE (TOBJECT);\n"
~" function INITINSTANCE (unnamedtype, OINTER) : ^TOBJECT;\n"
~" procedure CLEANUPINSTANCE (TOBJECT);\n"
~" function CLASSTYPE (unnamedtype) : record &LtPos;unknown>;\n"
~" function CLASSINFO (unnamedtype) : POINTER;\n"
~" function CLASSNAME (unnamedtype, SHORTSTRING) : SHORTSTRING;\n"
~" function CLASSNAMEIS (unnamedtype, SHORTSTRING) : BOOLEAN;\n"
~" function CLASSPARENT (unnamedtype) : record &LtPos;unknown>;\n"
~" function INSTANCESIZE (unnamedtype) : LONGINT;\n"
~" function INHERITSFROM (unnamedtype, CLASS, ) : BOOLEAN;\n"
~" function STRINGMESSAGETABLE (unnamedtype) : record &LtPos;unknown>;\n"
~" function METHODADDRESS (unnamedtype, SHORTSTRING) : POINTER;\n"
~" function METHODNAME (unnamedtype, OINTER1, H, ) : SHORTSTRING;\n"
~" function FIELDADDRESS (TOBJECT, SHORTSTRING) : POINTER;\n"
~" procedure AFTERCONSTRUCTION (TOBJECT); virtual;\n"
~" procedure BEFOREDESTRUCTION (TOBJECT); virtual;\n"
~" procedure DEFAULTHANDLERSTR (TOBJECT, var); virtual;\n"
~" procedure DISPATCH (TOBJECT, var); virtual;\n"
~" procedure DISPATCHSTR (TOBJECT, var); virtual;\n"
~" function GETINTERFACE (TOBJECT, TGUID, out) : BOOLEAN;\n"
~" function GETINTERFACEBYSTR (TOBJECT, SHORTSTRING, ut) : BOOLEAN;\n"
~" function GETINTERFACEENTRY (unnamedtype, GUID) : record &LtPos;unknown>;\n"
~" function GETINTERFACEENTRYBYSTR (unnamedtype, SHORTSTRING) : record &LtPos;unknown>;\n"
~" function GETINTERFACETABLE (unnamedtype) : record &LtPos;unknown>;\n"
~" function UNITNAME (unnamedtype, ANSISTRING) : record &LtPos;unknown>;\n"
~" function EQUALS (TOBJECT, TOBJECT) : BOOLEAN; virtual;\n"
~" function GETHASHCODE (TOBJECT) : LONGINT; virtual;\n"
~" function TOSTRING (TOBJECT, ANSISTRING) : record &LtPos;unknown>; virtual;\n"
~"end\n"
^done
(gdb)
&LtPos;info address FPC_RAISEEXCEPTION>
&"info address FPC_RAISEEXCEPTION\n"
~"Symbol "FPC_RAISEEXCEPTION" is at 0x40b3d0 in a file compiled without debugging.\n"
^done
(gdb)
<-break-insert *4240336>
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0040b3d0",at="&LtPos;fpc_raiseexception>",times="0",original-location="*4240336"}
(gdb)
&LtPos;info address FPC_BREAK_ERROR>
&"info address FPC_BREAK_ERROR\n"
~"Symbol "FPC_BREAK_ERROR" is at 0x40cbb0 in a file compiled without debugging.\n"
^done
(gdb)
<-break-insert *4246448>
^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0040cbb0",at="&LtPos;SYSTEM_HANDLEERRORADDRFRAME
LONGINT
POINTER$POINTER>",times="0",original-location="*4246448"}
(gdb)
&LtPos;info address FPC_RUNERROR>
&"info address FPC_RUNERROR\n"
~"Symbol "FPC_RUNERROR" is at 0x40cc90 in a file compiled without debugging.\n"
^done
(gdb)
<-break-insert *4246672>
^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x0040cc90",at="&LtPos;SYSTEM_RUNERROR$WORD>",times="0",original-location="*4246672"}
(gdb)
&LtPos;info file>
&"info file\n"
~"Symbols from "C:/Documents and Settings/Administrador/Meus documentos/teste/teste.exe".\n"
~"Local exec file:\n"
~"\t`C:/Documents and Settings/Administrador/Meus documentos/teste/teste.exe', file type pei-i386.\n"
~"\tEntry point: 0x522810\n"
~"\t0x00401000 - 0x00522830 is .text\n"
~"\t0x00523000 - 0x0056bb38 is .data\n"
~"\t0x0056c000 - 0x00572bb4 is .bss\n"
~"\t0x00573000 - 0x00575c8c is .idata\n"
~"\t0x00576000 - 0x0059996c is .rsrc\n"
^done
(gdb)
<-data-evaluate-expression sizeof(POINTER)>
^done,value="4"
(gdb)
<-break-insert -f foo>
&"Function "foo" not defined.\n"
^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="&LtPos;PENDING>",pending="foo",times="0",original-location="foo"}
(gdb)
<-break-delete 5>
^done
(gdb)
<-exec-run>
^error,msg="Error creating process C:/Documents and Settings/Administrador/Meus documentos/teste/teste.exe, (error 193)."
(gdb)
&LtPos;info program>
&"info program\n"
~"The program being debugged is not being run.\n"
^done
(gdb)
&LtPos;info pid>
&"info pid\n"
&"Undefined info command: "pid". Try "help info".\n"
^error,msg="Undefined info command: "pid". Try "help info"."
(gdb)
&LtPos;info threads>
&"info threads\n"
^done
(gdb)
I managed to get an XP system, but I can not reproduce. I put spaces, accented chars and umlauts in the path. just works.
Tried with the gdb version supplied by latest lazarus 0.9.29. (7.2-1 as you seem to have)
I have Winodws XP Sp3. English locale, but as indicated tried with none english chars. (I guess locale would matter, if your path had accented or other none latin chars, that may have been lost when pasting the gdb output.)
Which Service pack to you have? Which locale?
Does the problam happen with "C:\test abc\project1.exe"?
Thanks Martin. With the link you posted I could solve the problem.
I noticed there was a file called "Documents" (with no extension) in the C:/ folder. Then the dbg couldn't find anything under "Documents and Settings" as mentioned in the link you posted.
I just deleted that file and everything worked then.
Also, I did some more tests and found that if it were a folder called "Documents" or a file with extension (i.e "Documents.txt") it would not interfere and dbg still works.
So I think there is no bug at all, but an odd situation in my PC that caused this misbehavior. Thanks for the support.
ok, not sure if the issue is in Windows/XP itself, or in gdb. In either case, it can not be fixed in the IDE (the IDE gives a quoted name to gdb already).
I keep the issue open, as there are 2 improvements that can be done.
The error shown in the IDE can and should contain the error from gdb (error 193)
Since the app is not started the debugger should be reset to "stopped" state. Currently the IDE will still believe the debugger to be running, after the error)