News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Empty watch list in code::blocks

Started by evilgeniuz, July 10, 2011, 09:22:39 PM

Previous topic - Next topic

evilgeniuz

Hi everyone. I'm using code::blocks 10.05 under ubuntu 11.04. I need to debug my project. I've done everything that wiki told: enabled debug symbols, created new project... but... debugger doesn't want to stop at breakpoints (i'm pressing F8, realy!). I've noticed on wiki's screenshot, that watch window is filled, mine is empty. I've tried to add there smth, but no results.

oBFusCATed

Does debugging with command line gdb work for the executable built with C::B?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

evilgeniuz

No. It prints out the same that c::b prints.


evilgeniuz@VAIO:~/Projects/Code::Blocks/test1/parser/bin/Debug$ gdb parser
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/evilgeniuz/Projects/Code::Blocks/test1/parser/bin/Debug/parser...done.
(gdb) b 5
Breakpoint 1 at 0x804bf01: file /home/evilgeniuz/Projects/Code::Blocks/test1/parser/main.cpp, line 5.
(gdb) run
Starting program: /home/evilgeniuz/Projects/Code::Blocks/test1/parser/bin/Debug/parser
Error in re-setting breakpoint 1: Can't find member of namespace, class, struct, or union named "/home/evilgeniuz/Projects/Code::Blocks/test1/parser/main.cpp:5"
Hint: try '/home/evilgeniuz/Projects/Code::Blocks/test1/parser/main.cpp:5<TAB> or '/home/evilgeniuz/Projects/Code::Blocks/test1/parser/main.cpp:5<ESC-?>
(Note leading single quote.)
[Thread debugging using libthread_db enabled]
Could not open file.

Program exited normally.


But gdb worked for hello world project i've wrote and compiled from command line without c::b.

oBFusCATed

Have you read this: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Have you verified that your build is correct, no -O2, no -g, no -s options, no strip command.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

evilgeniuz

#4
Yes, i've done all of that. Also that project works with stopping at breakpoints on my friends laptop with same ubuntu(only gnome instead of unity) and of course same c::b. That drives me crazy :(

oBFusCATed

Have you tried a clean build?

p.s. in my previous post I've mistakenly posted "no -g", which is wrong, you need the -g options.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Put your  program in a path without colons (":") in the name.
gdb can not read the pathname correctly.
I tried it on commandline, neither the hint with the single-quotes, nor double-quotes or escaping with backslash works.

So as a quick solution, just use a path without colons in it.

Jenna

Quote from: jens on July 12, 2011, 06:45:16 AM
Put your  program in a path without colons (":") in the name.
gdb can not read the pathname correctly.
I tried it on commandline, neither the hint with the single-quotes, nor double-quotes or escaping with backslash works.

So as a quick solution, just use a path without colons in it.
You can also try to use relative paths in compilation, but this might break other debug-sessions.
It should not be harmful in most cases, but it's an option, that is used for compiling all projects with this compiler, so it should be used with care (or at least be kept in mind, that this change has been made, if something goes wrong later).

Uncheck "Settings -> Compiler and debugger... -> Global compiler settings -> [your compiler] -> Other settings -> Advanced options... -> Others -> Use full paths for source files (GDB workaround):" and do a full rebuild.


evilgeniuz

QuoteSo as a quick solution, just use a path without colons in it.

Man, i love you!
That solved the problem!