Bug 270967 - Run command in the script makes kdevelop stuck
Summary: Run command in the script makes kdevelop stuck
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
Depends on:
Reported: 2011-04-14 18:05 UTC by leon pollak
Modified: 2011-07-02 10:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description leon pollak 2011-04-14 18:05:29 UTC
Version:           git master (using KDE 4.5.5) 
OS:                Linux

The bug was explained and located by Volodya Prus. below is his mail. But the code is still not corrected:
It worked!
I commented the 'else' line and it started to work as required.

Thousands of thanks!

On Saturday January 22 2011, Vladimir Prus wrote:
> On Saturday, January 22, 2011 13:28:10 Leon Pollak wrote:
> > Volodya,
> > Excuse me, please, for tediousness - but please, only one sentence ...:-)
> > 
> > When, at what point are saved breakpoints inserted from kdevelop into
> > gdb? The rest I'll try to understand by myself...
> Leon,
> breakpoints are inserted in BreakpointController::sendMaybeAll, called from
> BreakpointController::slotEvent when it sees connected_to_program
> event.
> That event, in turn, is raised in DebugSession::startProgram -- except that
> it's not raised in the branch that is taked when gdb startup script is
> specified.
> It seems like the best solution is to lift
>         queueCmd(new GDBCommand(GDBMI::FileExecAndSymbols, executable,
> this, &DebugSession::handleFileExecAndSymbols, true));
>         raiseEvent(connected_to_program);
> code out of 'if' condition, so that it's always executed.
> Hope this helps. I would like to be more helpful, but I've just got home
> after a nearly 24-hours travel, so would not be able to do much myself
> until at least Tuesday.
> - Volodya

Reproducible: Didn't try
Comment 1 Niko Sams 2011-06-11 16:48:31 UTC
Please test this patch, does it fix the problem for you?

diff --git debuggers/gdb/debugsession.cpp debuggers/gdb/debugsession.cpp
index 32534e7..59528c2 100644
--- debuggers/gdb/debugsession.cpp
+++ debuggers/gdb/debugsession.cpp
@@ -1078,6 +1078,8 @@ bool DebugSession::startProgram(KDevelop::ILaunchConfiguration* cfg)
         queueCmd(new GDBCommand(GDBMI::NonMI, "source " + config_runGdbScript_.toLocalFile()));
         // Note: script could contain "run" or "continue"
+        raiseEvent(connected_to_program);
Comment 2 Niko Sams 2011-07-02 10:41:38 UTC
Git commit 1dfdc080a39f570eb1298a9d0128d3e623063467 by Niko Sams.
Committed on 02/07/2011 at 12:28.
Pushed by nsams into branch 'master'.

Fix inserting breakpoints for remote debugging

the breakpoints are sent on connected_to_program event, which was not
raised when a gdb script was used

BUG: 270967

M  +3    -0    debuggers/gdb/debugsession.cpp     
M  +80   -0    debuggers/gdb/unittests/gdbtest.cpp     
M  +2    -0    debuggers/gdb/unittests/gdbtest.h