Author Topic: Empty watch list in code::blocks  (Read 9479 times)

Offline evilgeniuz

  • Single posting newcomer
  • *
  • Posts: 4
Empty watch list in code::blocks
« on: July 10, 2011, 09:22:39 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Empty watch list in code::blocks
« Reply #1 on: July 11, 2011, 09:49:38 am »
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!]

Offline evilgeniuz

  • Single posting newcomer
  • *
  • Posts: 4
Re: Empty watch list in code::blocks
« Reply #2 on: July 11, 2011, 02:27:19 pm »
No. It prints out the same that c::b prints.

Code
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Empty watch list in code::blocks
« Reply #3 on: July 11, 2011, 02:32:47 pm »
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!]

Offline evilgeniuz

  • Single posting newcomer
  • *
  • Posts: 4
Re: Empty watch list in code::blocks
« Reply #4 on: July 11, 2011, 04:08:42 pm »
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 :(
« Last Edit: July 11, 2011, 04:37:02 pm by evilgeniuz »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Empty watch list in code::blocks
« Reply #5 on: July 12, 2011, 01:06:58 am »
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!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Empty watch list in code::blocks
« Reply #6 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Empty watch list in code::blocks
« Reply #7 on: July 12, 2011, 07:23:56 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255

Offline evilgeniuz

  • Single posting newcomer
  • *
  • Posts: 4
Re: Empty watch list in code::blocks
« Reply #9 on: July 12, 2011, 06:33:39 pm »
Quote
So as a quick solution, just use a path without colons in it.

Man, i love you!
That solved the problem!