Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » New Breakpoint causes SIGINT to process under debug
New Breakpoint causes SIGINT to process under debug [message #1848311] Sat, 27 November 2021 14:18 Go to next message
Gianluca Sorrentino is currently offline Gianluca SorrentinoFriend
Messages: 5
Registered: November 2021
Junior Member
Hi all,
in Eclipse 2021-09, Debian 11, GDB, G++, i can't add any breakpoint while debugging the application because it get's terminated with SIGING (2). Eclipse reports with the warning triangle the failure at the bp line but it then works as expected launching the debugger again.

Why is Eclipse sending CTRL+C to my application? How can i disable this behavior?
I suspect there is no such option about it considering i can't see why one should want the application to be terminated on every BP live insertion... but you never really know :)

Any Idea?
Thanks a lot
Re: New Breakpoint causes SIGINT to process under debug [message #1848350 is a reply to message #1848311] Mon, 29 November 2021 13:20 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Why do you think Eclipse is doing it and not GDB?
The following explains GDB breakpoint and signal handling
https://web.mit.edu/gnu/doc/html/gdb_7.html

[Updated on: Mon, 29 November 2021 13:20]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848368 is a reply to message #1848350] Tue, 30 November 2021 00:09 Go to previous messageGo to next message
Gianluca Sorrentino is currently offline Gianluca SorrentinoFriend
Messages: 5
Registered: November 2021
Junior Member
You are right about GDB sending SIGINT to the process (i'd say kind of obvious) but Eclipse controls GDB and this behavior does not occur with netbeans (for example).

Adding a new breakpoint (i'm guessing here, but with some confidence) is done by Eclipse passing the request to GDB, and here i think is where the problem comes from.

GDB is perfectly capable of not having to terminate the process to add a breakpoint live, as proven by other IDE... i have 0 knowledge about GDB and its interface but out of experience i can't help to blame Eclipse for this behavior of GDB (happy to be proven wrong if i am, there is always to learn).

It might just be that Netbeans and others use some sort of workaround when they detect issues with breakpoints, i simply don't know how they manage the case, but for sure they can navigate the issue.

Best Regards

[Updated on: Tue, 30 November 2021 00:12]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848371 is a reply to message #1848368] Tue, 30 November 2021 03:43 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
CDT runs GDB as a user would but through the MI interface
https://ftp.gnu.org/old-gnu/Manuals/gdb/html_chapter/gdb_22.html
A bit stale perhaps but basically the same as the one currently implemented.

Here's a deeper discussion of the internals of GDB breakpoints
https://sourceware.org/gdb/wiki/Internals/Breakpoint%20Handling
The Intel processors only have 4 hardware breakpoints and they can only be set at
privilege level 0. Not sure if this can be done when the program is running.
Definitely can't be running for a software breakpoint.

I suspect placing breakpoints on the JVM is easier than placing them on the native machine.

[Updated on: Tue, 30 November 2021 03:51]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848378 is a reply to message #1848371] Tue, 30 November 2021 12:16 Go to previous messageGo to next message
Gianluca Sorrentino is currently offline Gianluca SorrentinoFriend
Messages: 5
Registered: November 2021
Junior Member
Thanks for the links, i will definitively give a look into the topic for my personal knowledge.
I completely share your last comment about the JVM in respect to physical hardware complexity: i generally use a lot of virtualization and it's easy to see how far one can go in such environment without the difficulty of dealing with real devices (including the CPU).

Eclipse, if i remember it right, was born to be a JAVA IDE and would not surprise me if the debugging of a process is something relatively straightforward with the JVM and the abstractions it provides.

Unfortunately this impacts a lot the usability of Eclipse as project IDE with C++. My best guess is that this problem might not occur with all programs/libraries and some developers are able to get by with it anyway. By the way I think this shall be investigated, when possible.

For the sake of the record: GDB is not perfect in my experience (but still great!) and even using other IDE you can make it literally collapse sometimes setting a breakpoint or suspending the execution with "unfortunate timing", especially in multi threading.
Re: New Breakpoint causes SIGINT to process under debug [message #1848440 is a reply to message #1848378] Thu, 02 December 2021 08:07 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
You do realize that CDT is a plugin to Eclipse, yes? It uses the
editor framework but I don't see how the Java plugin affects
it.

GDB was likely chosen because of it's popularity, particularly
in the Linux world, is multiplatform and open source. The
debug interface in CDT is built around GDB. Using something
else probably would require a lot of effort.

You could of course volunteer if you think another debugger is
better and worth the time or maybe you can ask for your money
back.

[Updated on: Thu, 02 December 2021 08:15]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848462 is a reply to message #1848440] Fri, 03 December 2021 02:35 Go to previous messageGo to next message
Gianluca Sorrentino is currently offline Gianluca SorrentinoFriend
Messages: 5
Registered: November 2021
Junior Member
Just for clarity i wish to say that nothing i wrote was a complaint but merely a list of observations which i think you read from the wrong angle.

* I understands CDT is a plugin of Eclipse and I never implied that such aspect has anything to do with technological limitations of Java or whatever you think i said... my point was simply that it is possible that JAVA is easier to deal with when piloting the debugging process from the GUI/Editor (due to indirect code execution offered by the JVM) and that might have had an impact (initial lack of knowledge / architectural limitations / etc) when Eclipse has been extended (with a plugin) to C/C++.
* I never suggested GDB was not the right choice. My remark about its stability was just to make clear that i might expect to blame GDB sometimes and not necessarily the editor (misusing it): though i don't believe this is the case, so i posted this report.
* I don't think i was offending or demanding anything by reporting a problem with the software, normally developers are happy (at least i am) when they get a bug feedback because they can improve their creation ;)

[Updated on: Fri, 03 December 2021 02:36]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848463 is a reply to message #1848462] Fri, 03 December 2021 05:33 Go to previous messageGo to next message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
Quote:
don't think i was offending or demanding anything by reporting a problem with the software


No offense taken but, as stated, the issue is inherent in the way GDB operates with
nothing to do with CDT thus generally out of the hands of CDT developers. You
did, though, seem to be suggesting that someone (else) volunteer their free time
and effort into using another debugger and perhaps didn't realize it.

The best way to handle such change is to submit an enhancement request
through bugzilla where it might spark someone's interest -- particularly if it would
amount to a minimal change -- then willing to devote time into continued
maintenance. Chances are that might only be you and perhaps a few others.

Or, better yet, develop a CDT plugin to use another debugger and offer it to the
public and see how much interest it garners. This has been done with other
plugins (R from StatET for instance)

[Updated on: Fri, 03 December 2021 05:53]

Report message to a moderator

Re: New Breakpoint causes SIGINT to process under debug [message #1848595 is a reply to message #1848371] Thu, 09 December 2021 07:28 Go to previous message
tarun saini is currently offline tarun sainiFriend
Messages: 1
Registered: December 2021
Junior Member
Yes, i also face the same issue. Thank you for raising this query.
Previous Topic:Syntax Errors Indicated for Valid Lambda
Next Topic:Not able to set preference from plugin_customization.ini
Goto Forum:
  


Current Time: Wed Apr 24 19:30:52 GMT 2024

Powered by FUDForum. Page generated in 0.04736 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top