Bug 350916 - The debugger component does not stop on interrupt button and doesn't insert BP in running app
Summary: The debugger component does not stop on interrupt button and doesn't insert B...
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: CPP Debugger (show other bugs)
Version: 4.7.1
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-03 13:01 UTC by leon pollak
Modified: 2015-12-04 17:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Slightly corrected example with while(1) loop (7.19 KB, application/zip)
2015-08-03 13:02 UTC, leon pollak
Details
kdev-4.7.1-gdb.patch (1.06 KB, patch)
2015-08-03 21:29 UTC, Fernando Rodriguez
Details
kdevelop-4.7.1-gdb.patch (1.77 KB, patch)
2015-08-05 19:59 UTC, Fernando Rodriguez
Details
kdevelop-4.7.1-gdb-git.patch (2.00 KB, patch)
2015-08-05 20:07 UTC, Fernando Rodriguez
Details
Patch for current git branch (638 bytes, patch)
2015-08-23 19:09 UTC, Fernando Rodriguez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description leon pollak 2015-08-03 13:01:03 UTC
This bug report is continuation of the 346827 report.
Attached simulation environment from Olly Funkster slightly modified applies and is attached. Just, please, recompile it.

After running the application try to insert a BP or stop it - no reaction.

Reproducible: Always
Comment 1 leon pollak 2015-08-03 13:02:11 UTC
Created attachment 93863 [details]
Slightly corrected example with while(1) loop
Comment 2 Fernando Rodriguez 2015-08-03 21:29:45 UTC
Created attachment 93879 [details]
kdev-4.7.1-gdb.patch

Leon,

Give this patch a try and let me know if it works. Apply it to the 4.7.1 tarball.
It doesn't fix the interrupt problem with my setup but I only tested with QEMU and I think it's specific to it since I've had this problem before 4.7.0, I'm building the gdbserver to try your example.

This patch simply wraps the offending commit in #if statements (it's only meant for OSX) so it *should* restore the 4.7.0 behaviour on Linux.
Comment 3 Fernando Rodriguez 2015-08-03 22:11:21 UTC
Ok, I tested with gdbserver and everything works, including interrupt and breakpoints on the fly.
Comment 4 Fernando Rodriguez 2015-08-05 19:59:09 UTC
Created attachment 93903 [details]
kdevelop-4.7.1-gdb.patch

Cleaned up patch.
Comment 5 Fernando Rodriguez 2015-08-05 20:07:08 UTC
Created attachment 93904 [details]
kdevelop-4.7.1-gdb-git.patch

Patch for the git 4.7 branch.
Comment 6 Milian Wolff 2015-08-12 16:28:41 UTC
Leon, does this fix your issue? Fernando, please remember to put patches up for review on reviewboard, more people will look at them then.

thanks!
Comment 7 leon pollak 2015-08-12 17:09:16 UTC
Yes! It was exactly I needed.
Comment 8 Milian Wolff 2015-08-13 15:25:21 UTC
Git commit d051c4dc9b0495240eeda8a233a2c748d719ce14 by Milian Wolff, on behalf of Fernando Rodriguez.
Committed on 13/08/2015 at 15:24.
Pushed by mwolff into branch '4.7'.

Fix interrupt of debuggee in remote debugging sessions.

This fixes the insertion of breakpoints or stopping the debuggee
when using gdbserver for remote debugging.

NB: Code style adapted by Milian, hope I didn't break anything.

M  +12   -3    debuggers/gdb/gdb.cpp
M  +2    -0    debuggers/gdb/gdb.h

http://commits.kde.org/kdevelop/d051c4dc9b0495240eeda8a233a2c748d719ce14
Comment 9 Milian Wolff 2015-08-13 15:26:42 UTC
Thanks again Fernando! Please put your next patches up for review on reviewboard.kde.org.

Cheers
Comment 10 Milian Wolff 2015-08-13 15:42:43 UTC
I just tested this with KF5/KDevelop 5, there the patch doesn't seem to be required. The recent refactoring there seems to have fixed this among other things.
Comment 11 Fernando Rodriguez 2015-08-13 19:45:07 UTC
Hi Milian:

It looks like it didn't apply correctly. On GDB::processLine it applied the #endif line but not the #if (Q_OS_MAC) so it won't compile. The second patch (incorrectly named kdevelop-4.7.1-gdb-git.patch) was the one meant for the git 4.7 branch, it basicly reverts the patch from bug #346827 (in case it breaks OSX) and applies the new fix.
Comment 12 Milian Wolff 2015-08-14 00:46:23 UTC
Git commit 1715a0d59c70158a4c54d2d8b05e4181e73207b0 by Milian Wolff.
Committed on 14/08/2015 at 00:46.
Pushed by mwolff into branch '4.7'.

Unbreak build - sorry for that.

M  +2    -1    debuggers/gdb/gdb.cpp

http://commits.kde.org/kdevelop/1715a0d59c70158a4c54d2d8b05e4181e73207b0
Comment 13 Fernando Rodriguez 2015-08-21 02:30:59 UTC
On Friday, August 14, 2015 12:46:23 AM you wrote:
> https://bugs.kde.org/show_bug.cgi?id=350916
> 
> --- Comment #12 from Milian Wolff <mail@milianw.de> ---
> Git commit 1715a0d59c70158a4c54d2d8b05e4181e73207b0 by Milian Wolff.
> Committed on 14/08/2015 at 00:46.
> Pushed by mwolff into branch '4.7'.
> 
> Unbreak build - sorry for that.
> 
> M  +2    -1    debuggers/gdb/gdb.cpp
> 
> http://commits.kde.org/kdevelop/1715a0d59c70158a4c54d2d8b05e4181e73207b0

The "if (currentCmd_->cmdToSend().contains("exec-run"))" should be deleted to 
make sure it doesn't break anything for OSX. It's also on the -git patch.
Comment 14 Milian Wolff 2015-08-23 18:46:57 UTC
Sorry Fernando, I seem to have messed up the apply of this patch. Can you provide me a patch against the current 4.7 head and I'll apply that one - hopefully without screwing up so badly again?

Thanks, and sorry for this mess
Comment 15 Fernando Rodriguez 2015-08-23 19:09:36 UTC
Created attachment 94187 [details]
Patch for current git branch

Sure. I should've been more clear about which patch to apply.
Comment 16 Milian Wolff 2015-12-04 17:56:35 UTC
Fernando, sorry for the late reply. Did I apply your latest patch now or is this still pending?

Again, very sorry for the mess and lack of interaction from my side...