News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Debugging under Linux - setting breakpoints while running

Started by Mikhail, April 08, 2013, 04:16:21 AM

Previous topic - Next topic

Mikhail

Hi,

Let me make it clear:

Breakpoints which are set while program is running, are NOT reachable,
debugger does not break on them.

To reproduce the behavior start debugging, then set break
point (on menu handler or something like that).

Program will not break when you call this menu/

If break point is set before starting debugger or when debugger
is paused on some other break point, I can set new break point
and it is reachable.

Not all programs exhibit this.

My question is what possibly could cause this?
I use "-g" to enable debugging.

The program in question is too big to post.

Thank you,
Mikhail







ollydbg

Quote from: Mikhail on April 08, 2013, 04:16:21 AM
Hi,
When I  start debugging and then set break point then program breaks when this line
is reached. It does work and I had to compile example with wxWidgets to verify it.
However in my program (uses old wxwidgets) for some reason it does not happen -
when I start the program under debugger and set break point while running is never reached.
I can't understand your report, can you show us the exact steps to reproduce your bug?

BTW: Please edit your post, and wrap your log messages with code tags, thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

oBFusCATed

Also please redo the log that doesn't work after you've enabled full logging in the options of the debugger (Settings -> Debugger)
(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!]

MortenMacFly

Using both: -g and -s would cause such behaviour and is a common mistake. Post the full build log for more...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Mikhail

Attached is compilation and debug logs.

I am not using "-s" option.
When I tried to set break point debugger posted message (see in the log)

[debug]Code::Blocks is trying to interrupt process with pid: 4020; child pid: 0 gdb pid: 4020

Continuing...

It seems that actual point was only set on exit

[debug]> break "/home/misha/tmp/wxxt-1.67/samples/demo/demo.cpp:353"
[debug]Breakpoint 2 at 0x804fb53: file /home/misha/tmp/wxxt-1.67/samples/demo/demo.cpp, line 353.

Your help is appreciated,

Thank  you

Mikhail

[attachment deleted by admin]

oBFusCATed

(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!]

Mikhail

What could be done on my side to find out why it is failed?

If I start program outside of CB and then attach debugger to it
everything works as expected.

oBFusCATed

Quote from: Mikhail on April 09, 2013, 05:44:28 PM
What could be done on my side to find out why it is failed?
Nothing, I have to fix this bug.
(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!]

Mikhail

Let me know if you need code from me. I can package GUI lib + demo program + CB workspace