Bug #19352 2014-04-16 13:27

kneo

Debugging does not start when program arguments are set

Using Windows 7 x64 with Code::Blocks. (probleme persists in 12.11 and 13.11) Debugging with GDB.

How To Reproduce:

- Create a new "console application" project

- set a breakpoint at the "cout << ..." line

- debug (which now works)

Now:

- Set following program arguments (Project -> Set program' arguments):

D:\ D:\

(in the particular case I used a longer path but the effect is the same. Set two times the D:\ root directory as arguments)

- Debug (which now fails)

-> the debugger simply does not run the program

-> it seems to hang since nothing happens

-> also clicking the red "x" will not stop debugging (killing the gdb process does the trick)

Fix: set Arguments in double Quotes.

"D:\" "D:\" worked for me.

It took me hours to find the workaround for this bug. It is quite annoying since everything works with new clean projects as well as the day before with everything set as it was.

Nobody would expect this to be the cause.

Category
Debugger
Group
Platform:Windows
Status
Open
Close date
 
Assigned to
tpetrov
tpetrov 2014-05-12 19:30

Can you post the full log from the debugger? (see the settings how to enable it)

kneo 2014-05-13 08:33
Of course! As a matter of fact, I checked out this with my original project again and now it worked what ever you set in the programm settings. With or without qoutes.

So I used the method I described above to reproduce the problem. So the debugger still hangs, yet I can not say of it is related anyhow the the Quotes. I add the Log of the working with the Quotes as well.

>>>>>DEBUGGING WORKS:

Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\
Adding source dir: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\
Adding file: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\bin\Debug\test.exe
Changing directory to: C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/.
Set variable: PATH=.;C:\CodeBlocks\MinGW\bin;C:\CodeBlocks\MinGW;D:\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin;D:\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\libnvvp;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ManageSoft\Common;C:\Program Files (x86)\Borland\StarTeam SDK 10.4\Lib;C:\Program Files (x86)\Borland\StarTeam SDK 10.4\bin;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn;C:\Program Files (x86)\Borland\StarTeam SDK Runtime for .NET 10.4\bin;C:\Program Files\Borland\StarTeam SDK 12.5\lib;C:\Program Files\Borland\StarTeam SDK 12.5\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\CMake 2.8\bin;D:\android-ndk-r9d;C:\cygwin\bin;C:\Program Files (x86)\ARM\Mali Developer Tools\Mali Offline Compiler v4.1.0

[debug]Command-line: C:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/bin/Debug/test.exe
[debug]Working dir : C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test

Starting debugger: C:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/bin/Debug/test.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\bin\Debug\test.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.5

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/
[debug]Source directories searched: C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args D:\ D:\

Continuing...
Continuing...
Continuing...
Continuing...

<<<<<<DEBUGGING WORKS NOT

<Pressing continue does not work nothing actualy>

>>>>>>DEBUGGING WORKS:

Building to ensure sources are up-to-date
Selecting target: 
Debug
Adding source dir: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\
Adding source dir: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\
Adding file: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\bin\Debug\test.exe
Changing directory to: C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/.
Set variable: PATH=.;C:\CodeBlocks\MinGW\bin;C:\CodeBlocks\MinGW;D:\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin;D:\android-ndk-r9d\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\libnvvp;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ManageSoft\Common;C:\Program Files (x86)\Borland\StarTeam SDK 10.4\Lib;C:\Program Files (x86)\Borland\StarTeam SDK 10.4\bin;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn;C:\Program Files (x86)\Borland\StarTeam SDK Runtime for .NET 10.4\bin;C:\Program Files\Borland\StarTeam SDK 12.5\lib;C:\Program Files\Borland\StarTeam SDK 12.5\bin;C:\Program Files (x86)\MiKTeX 2.9\miktex\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\CMake 2.8\bin;D:\android-ndk-r9d;C:\cygwin\bin;C:\Program Files (x86)\ARM\Mali Developer Tools\Mali Offline Compiler v4.1.0

[debug]Command-line: C:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/bin/Debug/test.exe
[debug]Working dir : C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test

Starting debugger: C:\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/bin/Debug/test.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\bin\Debug\test.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.5

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/
[debug]Source directories searched: C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args "D:\" "D:\"
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/kkrueger/Desktop/glyphy/GlyphyDev/test/main.cpp:7"
[debug]Breakpoint 2 at 0x40134a: file C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp, line 7.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\bin\Debug\test.exe "D:\" "D:\"

Child process PID: 3516

[debug][New Thread 3516.0x1830]
[debug]Breakpoint 2, main () at C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp:7
[debug]C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp:7:62:beg:0x40134a
[debug]>>>>>>cb_gdb:

At C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp:7

[debug]> info locals
[debug]No locals.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No arguments.
[debug]>>>>>>cb_gdb:
[debug]> info registers
[debug]eax            0x2	2
[debug]ecx            0x1	1
[debug]edx            0x8e3b8	582584
[debug]ebx            0x7efde000	2130567168
[debug]esp            0x28ff00	0x28ff00
[debug]ebp            0x28ff18	0x28ff18
[debug]esi            0x0	0
[debug]edi            0x0	0
[debug]eip            0x40134a	0x40134a <main()+22>
[debug]eflags         0x202	[ IF ]
[debug]cs             0x23	35
[debug]ss             0x2b	43
[debug]ds             0x2b	43
[debug]es             0x2b	43
[debug]fs             0x53	83
[debug]gs             0x2b	43
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0  main () at C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp:7
[debug]>>>>>>cb_gdb:
[debug]> if 1
disassemble 0x40134a
info frame
end
[debug] > > >Dump of assembler code for function main():
[debug]   0x00401334 <+0>:	lea    0x4(%esp),%ecx
[debug]   0x00401338 <+4>:	and    $0xfffffff0,%esp
[debug]   0x0040133b <+7>:	pushl  -0x4(%ecx)
[debug]   0x0040133e <+10>:	push   %ebp
[debug]   0x0040133f <+11>:	mov    %esp,%ebp
[debug]   0x00401341 <+13>:	push   %ecx
[debug]   0x00401342 <+14>:	sub    $0x14,%esp
[debug]   0x00401345 <+17>:	call   0x416590 <__main>
[debug]=> 0x0040134a <+22>:	movl   $0x46e024,0x4(%esp)
[debug]   0x00401352 <+30>:	movl   $0x477860,(%esp)
[debug]   0x00401359 <+37>:	call   0x468db8 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x0040135e <+42>:	movl   $0x467a14,(%esp)
[debug]   0x00401365 <+49>:	mov    %eax,%ecx
[debug]   0x00401367 <+51>:	call   0x449424 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]   0x0040136c <+56>:	sub    $0x4,%esp
[debug]   0x0040136f <+59>:	mov    $0x0,%eax
[debug]   0x00401374 <+64>:	mov    -0x4(%ebp),%ecx
[debug]   0x00401377 <+67>:	leave  
[debug]   0x00401378 <+68>:	lea    -0x4(%ecx),%esp
[debug]   0x0040137b <+71>:	ret    
[debug]End of assembler dump.
[debug]Stack level 0, frame at 0x28ff30:
[debug] eip = 0x40134a in main (C:\Users\kkrueger\Desktop\glyphy\GlyphyDev\test\main.cpp:7); saved eip 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args: 
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug]  ebp at 0x28ff18, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:
[debug]> x/32xb 0x0
[debug]Cannot access memory at address 0x0
[debug]0x0:	>>>>>>cb_gdb:
[debug]> disassemble 0x0040134a
[debug]Dump of assembler code for function main():
[debug]   0x00401334 <+0>:	lea    0x4(%esp),%ecx
[debug]   0x00401338 <+4>:	and    $0xfffffff0,%esp
[debug]   0x0040133b <+7>:	pushl  -0x4(%ecx)
[debug]   0x0040133e <+10>:	push   %ebp
[debug]   0x0040133f <+11>:	mov    %esp,%ebp
[debug]   0x00401341 <+13>:	push   %ecx
[debug]   0x00401342 <+14>:	sub    $0x14,%esp
[debug]   0x00401345 <+17>:	call   0x416590 <__main>
[debug]=> 0x0040134a <+22>:	movl   $0x46e024,0x4(%esp)
[debug]   0x00401352 <+30>:	movl   $0x477860,(%esp)
[debug]   0x00401359 <+37>:	call   0x468db8 <std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)>
[debug]   0x0040135e <+42>:	movl   $0x467a14,(%esp)
[debug]   0x00401365 <+49>:	mov    %eax,%ecx
[debug]   0x00401367 <+51>:	call   0x449424 <std::ostream::operator<<(std::ostream& (*)(std::ostream&))>
[debug]   0x0040136c <+56>:	sub    $0x4,%esp
[debug]   0x0040136f <+59>:	mov    $0x0,%eax
[debug]   0x00401374 <+64>:	mov    -0x4(%ebp),%ecx
[debug]   0x00401377 <+67>:	leave  
[debug]   0x00401378 <+68>:	lea    -0x4(%ecx),%esp
[debug]   0x0040137b <+71>:	ret    
[debug]End of assembler dump.
[debug]>>>>>>cb_gdb:
[debug]> quit

Debugger finished with status 0

<<<<<DEBUGGING WORKS
kneo 2014-05-13 08:39

I would gladly provide the project files as well. I don't know how to attach files to this bug.

tpetrov 2014-05-13 18:20

No need for a project, I'm able to reproduce it on linux, too.