User forums > Using Code::Blocks

Don't understand debugging..???

<< < (4/8) > >>

BlueHazzard:
No, i didn't change anything....
i updated only gdb, but before it also didnt work.....

thx

johne53:

--- Quote from: jens on October 26, 2007, 03:02:35 pm ---Exactly the same here svn4561 on debian.

[...]

Breakpoints in Line 8 and 10

Works with gdb on console, but not in C::B.
In C::B it stops in line 10, but not line 8.
--- End quote ---
Maybe that's a good sign - at least is suggests C::B as being the possible cause. I hope that one of the developers can reproduce this and come up with an explanation - because it might get us nearer to understanding why C::B and gdb are so unreliable together.



--- Quote from: jens on October 26, 2007, 03:02:35 pm ---<Edit>
No, not exactly the same. Only with the simple example, not in a bigger wxWidgets project.
</Edit>
--- End quote ---
That's what I'm finding too. Different projects suffer different problems and some don't seem to have any problems at all. The last bug I reported (inexplicable segfaults while closing C::B) turned out to be an errant plug-in. I really hope that someone will be able to track this one down because, for me at least, it's making C::B equally unreliable.

Biplab:

--- Quote from: johne53 on October 27, 2007, 09:27:34 am ---Maybe that's a good sign - at least is suggests C::B as being the possible cause. I hope that one of the developers can reproduce this and come up with an explanation - because it might get us nearer to understanding why C::B and gdb are so unreliable together.

--- End quote ---

Just posting it doesn't work without providing any information or Unnecessarily ranting devs (assuming you are the Big-Boss) would yield nothing. If you're unable to provide any information related to the bug, then our answer is also simple - "It works for us".

Why don't you provide more info as Jens did? Your posts are always Full of Rants, FUDs (this doesn't work / that doesn't work, etc).

Did you ever try to find out why this problem exists when the same command-line works on Windows and doesn't work on Linux? But you have already opined that it's a C::B problem.

Can you tell me why the devs should "come up with an explanation"? Isn't that too rude??

If you find C::B too unreliable, why don't you make some efforts to make it a reliable one??

Jenna:
<Edit>
Hi Biplap,
our posts crossed each other.
Here's a little more information:
</Edit>

I'm not sure, but I think I pointed out the problem:

gdb runs the program using the "start"-instruction.
That makes gdb stop at the begin of the "main"-function.
gdb automatically set a breakpoint (breakpoint 3 in snippet below), if it has stopped "info program" is called.
and then the "cont"-instruction is called.

I guess codeblocks "thinks" gdb stopped at automatically set breakpoint (what's right of course), and does not know (or does not remember or ignore) that the user has set a breakpoint at the same line.

If I set the first breakpoint at the second instruction in main codeblocks stops there as wanted.


--- Quote from: jens on October 26, 2007, 03:02:35 pm ---
--- Code: ---LD_LIBRARY_PATH=.:
>>>>>>cb_gdb:
> start
Breakpoint 3 at 0x8048a51: file /tmp/test2/main.cpp, line 8.
[Thread debugging using libthread_db enabled]
[New Thread 0xb69b8a10 (LWP 9060)]
[Switching to Thread 0xb69b8a10 (LWP 9060)]
Breakpoint 2, main () at /tmp/test2/main.cpp:8
/tmp/test2/main.cpp:8:81:beg:0x8048a51
>>>>>>cb_gdb:
> info program
Using the running image of child Thread 0xb69b8a10 (LWP 9060).
Program stopped at 0x8048a51.
It stopped at breakpoint 2.
It stopped at a breakpoint that has since been deleted.
Type "info stack" or "info registers" for more information.
>>>>>>cb_gdb:
> cont

--- End code ---

--- End quote ---

Short:
a breakpoint at the first instruction in main is ignored by codeblocks, because there is also an auto-breakpoint set by gdb's "start"-instruction.

<Edit2>
On windows gdb ist started with the "run"-instruction, which makes gdb run to the first breakpoint. So debugging works in this case as expected.
</Edit2>

Biplab:

--- Quote from: jens on October 27, 2007, 10:46:01 am ---<Edit>
Hi Biplap,
our posts crossed each other.
Here's a little more information:
</Edit>

I'm not sure, but I think I pointed out the problem:

--- End quote ---

I'm also not sure about this. I faced this issue long back and I made a small change in the way breakpoints are added. That solved the issue.

Let me find out the patch. I'll post it. But I don't know why that patch works. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version