Bug 214372 - Breakpoints set while a debugging session is running are not recognised
Summary: Breakpoints set while a debugging session is running are not recognised
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: VHI normal
Target Milestone: 4.0.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-13 12:19 UTC by Martin Heimlich
Modified: 2009-11-27 19:34 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testproject to reproduce bug (745 bytes, application/gzip)
2009-11-13 12:20 UTC, Martin Heimlich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Heimlich 2009-11-13 12:19:28 UTC
Version:           CVS (13.11.2009) (using KDE 4.3.3)
Compiler:          g++ (Ubuntu 4.4.1-4ubuntu8) 4.4.1 
OS:                Linux
Installed from:    Ubuntu Packages

When I set breakpoints before I start the program the debugger correctly stops at them.
When I add them while the program is running the debugger doesn't stop.

How to reproduce:

I attached a test project:

1.) build it
2.) setup the executable in the project settings (for me it works only having an absolute path set, but this is a different issue)
3.) debug it
4.) add a breakpoint in the while loop.

Expected Behaviour:

The debugger should stop.
Comment 1 Martin Heimlich 2009-11-13 12:20:00 UTC
Created attachment 38300 [details]
Testproject to reproduce bug
Comment 2 Martin Heimlich 2009-11-13 12:50:48 UTC
I forgot to mention the gdb version I'm using:

gdb --version
GNU gdb (GDB) 7.0-ubuntu
Comment 3 Martin Heimlich 2009-11-13 12:58:19 UTC
Just to make sure: I did not install kdevelop from ubuntu packages but built it from subverion today.
Comment 4 Andreas Pakulat 2009-11-13 13:40:40 UTC
I can reproduce this here.
Comment 5 Olivier.jg 2009-11-18 07:14:59 UTC
This was broken by r1022390. The comment there was:

"Kill the s_appRunning state. For one thing, GDB in non-stop mode does not even
 have such a concept, as each thread can be run and stopped individually.
 Secondly, this is only used to display status messages, to a non-existent
 status bar."

The second reason is not really the case however, because removing that state means the GDB debugger is never set to ActiveState or PausedState, which means that when KDevPlatform detects a new breakpoint added during one of those states, it won't notify GDB to add it.

Due to that, it should probably be reverted, at least till there's something else in place that will set those states.
Comment 6 Vladimir Prus 2009-11-18 07:26:30 UTC
Thanks for analysis. Looking into this now.
Comment 7 Niko Sams 2009-11-18 08:08:07 UTC
Additional Bug: Debugger actions (run, step etc) are not correctly disabled when debugee is running.

Would it be a good idea to have this state not per DebugSession but per thread?
Comment 8 Niko Sams 2009-11-18 14:33:11 UTC
btw, that additional bug is #213414
Comment 9 Vladimir Prus 2009-11-18 14:38:59 UTC
I am indeed thinking about making something -- not yet clear what -- track the state of each thread. For gdb all-stop mode, every thread will have the same state, while for gdb non-stop mode, when we support it, every thread might have different state. Then, the buttons will be enabled or disabled depending on whether the current thread is running or not. I'm still looking into implementation details.
Comment 10 Niko Sams 2009-11-27 19:34:05 UTC
fixed in rev. 1055240