* GDB doesn't interrupt target @ 2019-12-18 14:20 Tudor Popescu 2019-12-18 14:59 ` Pedro Alves 0 siblings, 1 reply; 9+ messages in thread From: Tudor Popescu @ 2019-12-18 14:20 UTC (permalink / raw) To: gdb Hello, I am using an eclipse-based IDE and a gdb/gdbserver combination for aarch64 targets. GDB version we use is 8.2.1 on a Linux host. Main problem is GDB doesn't interrupt the target when Ctrl-C is sent to eclipse's Debugger Console. Same thing happens when using kill -2 on pidof(gdb), or when pressing suspend button in eclipse. As far as I can tell, GDB 8.2.1 is launched with 2 interpreters: console and mi2. The actual arguments are: --interpreter mi2 -q --interpreter console -ex "new-ui mi /dev/pts/5" -ex "set pagination off" -ex "show version" The old GDB 7.11.1 we used, received only "–interpreter mi2 --nx" as arguments and everything related to target interrupt was working as expected. From my investigation, the behavior described above is somehow related to the terminal management (and also target_terminal::is_ours()). Looks like when eclipse is involved, target_pass_ctrlc() is never called. My understanding is that we need target_terminal::is_ours() to return false in order to interrupt the target. But this never happens on my setup. What I need, is a way to interrupt the target while target is running. Also, I would like to understand what is causing the above mentioned behavior. I know that GDB 7.12+ introduced some changes to support a prettier Debugger Console in eclipse and this seems to impact somehow the interrupt functionality in my case. So the main question is how do I make GDB 8.2.1 behave like GDB 7.11.1 when it comes to target interrupting (e.g. Ctrl+C)? Are there any special arguments that need to be passed to GDB? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-18 14:20 GDB doesn't interrupt target Tudor Popescu @ 2019-12-18 14:59 ` Pedro Alves 2019-12-18 15:49 ` Jonah Graham 0 siblings, 1 reply; 9+ messages in thread From: Pedro Alves @ 2019-12-18 14:59 UTC (permalink / raw) To: Tudor Popescu, gdb On 12/18/19 2:20 PM, Tudor Popescu wrote: > Hello, > > I am using an eclipse-based IDE and a gdb/gdbserver combination for aarch64 > targets. GDB version we use is 8.2.1 on a Linux host. > > Main problem is GDB doesn't interrupt the target when Ctrl-C is sent to > eclipse's Debugger Console. Same thing happens when using kill -2 on > pidof(gdb), or when pressing suspend button in eclipse. > > As far as I can tell, GDB 8.2.1 is launched with 2 interpreters: console > and mi2. The actual arguments are: > --interpreter mi2 -q --interpreter console -ex "new-ui mi /dev/pts/5" -ex > "set pagination off" -ex "show version" > > The old GDB 7.11.1 we used, received only "–interpreter mi2 --nx" as > arguments and everything related to target interrupt was working as > expected. > > From my investigation, the behavior described above is somehow related to > the terminal management (and also target_terminal::is_ours()). Looks like > when eclipse is involved, target_pass_ctrlc() is never called. My > understanding is that we need target_terminal::is_ours() to return false in > order to interrupt the target. But this never happens on my setup. > > What I need, is a way to interrupt the target while target is running. > Also, I would like to understand what is causing the above mentioned > behavior. I know that GDB 7.12+ introduced some changes to support a > prettier Debugger Console in eclipse and this seems to impact somehow the > interrupt functionality in my case. > > So the main question is how do I make GDB 8.2.1 behave like GDB 7.11.1 when > it comes to target interrupting (e.g. Ctrl+C)? Are there any special > arguments that need to be passed to GDB? So what _do_ you see when you "kill -2" gdb? Do you see a "Quit" being printed? I.e., the GDB console is accepting commands while the target is running? I assume Eclipse sends "set mi-async on" or "set target-async on" nowadays. The right way to interrupt the target is to send -exec-interrupt via the MI channel. Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-18 14:59 ` Pedro Alves @ 2019-12-18 15:49 ` Jonah Graham [not found] ` <CAHrp7QDmyiyyXtpcA_XSN41=eZM3eT3vwhuY5e9WTCqHGD_k1g@mail.gmail.com> 0 siblings, 1 reply; 9+ messages in thread From: Jonah Graham @ 2019-12-18 15:49 UTC (permalink / raw) To: Pedro Alves; +Cc: Tudor Popescu, GDB Development On Wed, 18 Dec 2019 at 09:59, Pedro Alves <palves@redhat.com> wrote: > On 12/18/19 2:20 PM, Tudor Popescu wrote: > > What I need, is a way to interrupt the target while target is running. > The way to do this is press the "Suspend" button in the toolbar in Eclipse, or typing the "interrupt" command in the Debugger Console. If these don't both work for you, there may be a bug in CDT. Please raise a bug against CDT on https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT and I will look at it. Please be sure to include where you got your Eclipse from - if it is from a vendor they may be the one with the issue and you should probably be in touch with them first. > > Also, I would like to understand what is causing the above mentioned > > behavior. I know that GDB 7.12+ introduced some changes to support a > > prettier Debugger Console in eclipse and this seems to impact somehow the > > interrupt functionality in my case. > Yes, this is the case. The GDB folk did some great work so that a fully fledged GDB console can be integrated in an IDE and that is what CDT does with GDB >= 7.12 on Linux hosts. > > > > So the main question is how do I make GDB 8.2.1 behave like GDB 7.11.1 > when > > it comes to target interrupting (e.g. Ctrl+C)? Are there any special > > arguments that need to be passed to GDB? > You would have to change how GDB is integrated into CDT rather than changing GDB. However I hope the above answers mean you don't need that. > > So what _do_ you see when you "kill -2" gdb? Do you see a "Quit" being > printed? > I.e., the GDB console is accepting commands while the target is running? > > I assume Eclipse sends "set mi-async on" or "set target-async on" nowadays. > > CDT uses -gdb-set target-async on > The right way to interrupt the target is to send -exec-interrupt via the > MI channel. > > That is what CDT does . I hope that helps, Jonah ~~~ Jonah Graham Kichwa Coders www.kichwacoders.com ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <CAHrp7QDmyiyyXtpcA_XSN41=eZM3eT3vwhuY5e9WTCqHGD_k1g@mail.gmail.com>]
* Re: GDB doesn't interrupt target [not found] ` <CAHrp7QDmyiyyXtpcA_XSN41=eZM3eT3vwhuY5e9WTCqHGD_k1g@mail.gmail.com> @ 2019-12-19 14:22 ` Pedro Alves 2019-12-19 14:47 ` Jonah Graham 0 siblings, 1 reply; 9+ messages in thread From: Pedro Alves @ 2019-12-19 14:22 UTC (permalink / raw) To: Tudor Popescu, Jonah Graham; +Cc: GDB Development On 12/19/19 1:10 PM, Tudor Popescu wrote: > Indeed the "interrupt" works on Debugger Console, as for the Suspend, the console prints a "^CQuit" just as when killing. This suggests that the suspend button is sending a SIGINT to GDB instead of issing an -exec-interrupt command on the MI channel. (MI's -exec-interrupt command is the equivalent of the "interrupt" command on the console.) Thanks, Pedro Alves ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-19 14:22 ` Pedro Alves @ 2019-12-19 14:47 ` Jonah Graham 2019-12-20 15:37 ` Tudor Popescu 0 siblings, 1 reply; 9+ messages in thread From: Jonah Graham @ 2019-12-19 14:47 UTC (permalink / raw) To: Pedro Alves; +Cc: Tudor Popescu, GDB Development On Thu, 19 Dec 2019 at 09:22, Pedro Alves <palves@redhat.com> wrote: > On 12/19/19 1:10 PM, Tudor Popescu wrote: > > Indeed the "interrupt" works on Debugger Console, as for the Suspend, > the console prints a "^CQuit" just as when killing. > This suggests that the suspend button is sending a SIGINT to GDB instead of > issing an -exec-interrupt command on the MI channel. (MI's -exec-interrupt > command is the equivalent of the "interrupt" command on the console.) > > Thank you Pedro for confirming. Tudor, where did you get your Eclipse from? If it is a fairly recent and unmodified/extended CDT I should be able to reproduce this, but I am going to need some more details on exactly how you are using it. Which type of launch are you doing for example. If you are using (or writing) a vendor extension to CDT it could be that the vendor has overridden the implementation of RunControl.suspend() that is in used by GDBRunControl_7_12 for GDB >= 7.12. Please raise a bug <https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT> in CDT with the details and I can look at it further. Thanks, Jonah ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-19 14:47 ` Jonah Graham @ 2019-12-20 15:37 ` Tudor Popescu 2019-12-20 16:23 ` Jonah Graham 0 siblings, 1 reply; 9+ messages in thread From: Tudor Popescu @ 2019-12-20 15:37 UTC (permalink / raw) To: Jonah Graham; +Cc: Pedro Alves, GDB Development Hello, Well we have the following versions: org.eclipse.cdt 9.3.0.201706122201 org.eclipse.cdt.dsf.gdb 5.3.0.201706122201 org.eclipse.cdt.dsf.gdb.ui 2.6.0.201706122201 On Windows, the suspend works. Should it work on Linux as well? All the best, Tudor On Thu, Dec 19, 2019 at 4:47 PM Jonah Graham <jonah@kichwacoders.com> wrote: > On Thu, 19 Dec 2019 at 09:22, Pedro Alves <palves@redhat.com> wrote: > >> On 12/19/19 1:10 PM, Tudor Popescu wrote: >> > Indeed the "interrupt" works on Debugger Console, as for the Suspend, >> the console prints a "^CQuit" just as when killing. >> This suggests that the suspend button is sending a SIGINT to GDB instead >> of >> issing an -exec-interrupt command on the MI channel. (MI's >> -exec-interrupt >> command is the equivalent of the "interrupt" command on the console.) >> >> > Thank you Pedro for confirming. > > Tudor, where did you get your Eclipse from? If it is a fairly recent and > unmodified/extended CDT I should be able to reproduce this, but I am going > to need some more details on exactly how you are using it. Which type of > launch are you doing for example. If you are using (or writing) a vendor > extension to CDT it could be that the vendor has overridden the > implementation of RunControl.suspend() that is in used > by GDBRunControl_7_12 for GDB >= 7.12. > > Please raise a bug > <https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT> in CDT with the > details and I can look at it further. > > Thanks, > Jonah > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-20 15:37 ` Tudor Popescu @ 2019-12-20 16:23 ` Jonah Graham 2019-12-23 14:37 ` Tudor Popescu 0 siblings, 1 reply; 9+ messages in thread From: Jonah Graham @ 2019-12-20 16:23 UTC (permalink / raw) To: Tudor Popescu; +Cc: Pedro Alves, GDB Development (resending because last email with embedded picture bounced) On Fri, 20 Dec 2019 at 10:37, Tudor Popescu <popescu.m.tudor@gmail.com> wrote: > > Hello, > > Well we have the following versions: > > org.eclipse.cdt 9.3.0.201706122201 > org.eclipse.cdt.dsf.gdb 5.3.0.201706122201 > org.eclipse.cdt.dsf.gdb.ui 2.6.0.201706122201 I can't immediately see any significant changes since this version was released. However, there are a few patch releases for CDT 9.3, current one is 9.3.3 (https://www.eclipse.org/cdt/downloads.php) (p2 https://download.eclipse.org/tools/cdt/releases/9.3/). Have you tried with something more recent. The new-ui support was very new when 9.3 was released, so there may be some bug fixes. In fact, CDT 9.3 was released more than a year before the version of GDB you are using. While I always hope that we release CDT that will work with future and unreleased GDBs, it is hard to be certain of that. Can you please report back if this is failing in most recent CDT releases (CDT 9.10 https://www.eclipse.org/cdt/downloads.php part of Eclipse 2019-12 release https://www.eclipse.org/downloads/) > > On Windows, the suspend works. Should it work on Linux as well? On Windows there is no new-ui (yet!), so the code paths in Eclipse are very different for this. Of course suspend *should* work on both. Please raise a bug (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT) in CDT with the details and I can look at it further. In addition to the version of those bundles, I need what launch configuration you are using. You can either share your .launch file, or if that is not possible tell me what is selected in Debug Configurations dialog on the left (launch config type) and if present which launcher (this area, next to revert/apply buttons may be blank). See https://i.imgur.com/wIkAb0U.png And it would be most useful to include the MI trace to see what is going wrong. If it off by default, but you can turn it on in Preferences -> C/C++ -> Debug -> GDB and check "Show the GDB traces [...]". Once enabled the Console view will display the MI trace. I hope we can get to the bottom of this. > > All the best, > Tudor ~~~ Jonah Graham Kichwa Coders www.kichwacoders.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-20 16:23 ` Jonah Graham @ 2019-12-23 14:37 ` Tudor Popescu 2019-12-23 16:32 ` Jonah Graham 0 siblings, 1 reply; 9+ messages in thread From: Tudor Popescu @ 2019-12-23 14:37 UTC (permalink / raw) To: Jonah Graham; +Cc: Pedro Alves, GDB Development Hello, I have tracked the problem to a link: Wiki.eclipse.org/CDT/FullGDBConsole. Junit test failures #2 and things to work on #1 are the exact descriptions of my problem. The page hasn't been updated since 2016. Can you tell me how were these issues addressed? Maybe it involves just replacing a jar? plugin. On Friday, December 20, 2019, Jonah Graham <jonah@kichwacoders.com> wrote: > (resending because last email with embedded picture bounced) > > > On Fri, 20 Dec 2019 at 10:37, Tudor Popescu <popescu.m.tudor@gmail.com> wrote: >> >> Hello, >> >> Well we have the following versions: >> >> org.eclipse.cdt 9.3.0.201706122201 >> org.eclipse.cdt.dsf.gdb 5.3.0.201706122201 >> org.eclipse.cdt.dsf.gdb.ui 2.6.0.201706122201 > > I can't immediately see any significant changes since this version was > released. However, there are a few patch releases for CDT 9.3, current > one is 9.3.3 (https://www.eclipse.org/cdt/downloads.php) (p2 > https://download.eclipse.org/tools/cdt/releases/9.3/). Have you tried > with something more recent. The new-ui support was very new when 9.3 > was released, so there may be some bug fixes. In fact, CDT 9.3 was > released more than a year before the version of GDB you are using. > While I always hope that we release CDT that will work with future and > unreleased GDBs, it is hard to be certain of that. Can you please > report back if this is failing in most recent CDT releases (CDT 9.10 > https://www.eclipse.org/cdt/downloads.php part of Eclipse 2019-12 > release https://www.eclipse.org/downloads/) > >> >> On Windows, the suspend works. Should it work on Linux as well? > > > On Windows there is no new-ui (yet!), so the code paths in Eclipse are > very different for this. Of course suspend *should* work on both. > > Please raise a bug > (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT) in CDT with > the details and I can look at it further. In addition to the version > of those bundles, I need what launch configuration you are using. You > can either share your .launch file, or if that is not possible tell me > what is selected in Debug Configurations dialog on the left (launch > config type) and if present which launcher (this area, next to > revert/apply buttons may be blank). See > https://i.imgur.com/wIkAb0U.png > > And it would be most useful to include the MI trace to see what is > going wrong. If it off by default, but you can turn it on in > Preferences -> C/C++ -> Debug -> GDB and check "Show the GDB traces > [...]". Once enabled the Console view will display the MI trace. > > I hope we can get to the bottom of this. > > >> >> All the best, >> Tudor > > > ~~~ > Jonah Graham > Kichwa Coders > www.kichwacoders.com > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: GDB doesn't interrupt target 2019-12-23 14:37 ` Tudor Popescu @ 2019-12-23 16:32 ` Jonah Graham 0 siblings, 0 replies; 9+ messages in thread From: Jonah Graham @ 2019-12-23 16:32 UTC (permalink / raw) To: Tudor Popescu; +Cc: Pedro Alves, GDB Development On Mon, 23 Dec 2019 at 09:37, Tudor Popescu <popescu.m.tudor@gmail.com> wrote: > > Hello, > > I have tracked the problem to a link: > Wiki.eclipse.org/CDT/FullGDBConsole. > Junit test failures #2 and things to work on #1 are the exact descriptions of my problem. The page hasn't been updated since 2016. Thanks Tudor for pointing out this document on the Wiki - it was a status report on the development of the new feature and does not represent the released state of CDT. I have marked the page as obsolete. > Can you tell me how were these issues addressed? The key part - async comms - cam as part of CDT 9.2 when the new-ui was rolled out. See the New and Noteworthy: https://wiki.eclipse.org/CDT/User/NewIn92#Running_All-stop_mode_Asynchronously Please raise a bug (https://bugs.eclipse.org/bugs/enter_bug.cgi?product=CDT) in CDT with the details and I can look at it further. In addition to the version of those bundles, I need what launch configuration you are using. You can either share your .launch file, or if that is not possible tell me what is selected in Debug Configurations dialog on the left (launch config type) and if present which launcher (this area, next to revert/apply buttons may be blank). See https://i.imgur.com/wIkAb0U.png And it would be most useful to include the MI trace to see what is going wrong. If it off by default, but you can turn it on in Preferences -> C/C++ -> Debug -> GDB and check "Show the GDB traces [...]". Once enabled the Console view will display the MI trace. I hope we can get to the bottom of this. Jonah ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-12-23 16:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-18 14:20 GDB doesn't interrupt target Tudor Popescu
2019-12-18 14:59 ` Pedro Alves
2019-12-18 15:49 ` Jonah Graham
[not found] ` <CAHrp7QDmyiyyXtpcA_XSN41=eZM3eT3vwhuY5e9WTCqHGD_k1g@mail.gmail.com>
2019-12-19 14:22 ` Pedro Alves
2019-12-19 14:47 ` Jonah Graham
2019-12-20 15:37 ` Tudor Popescu
2019-12-20 16:23 ` Jonah Graham
2019-12-23 14:37 ` Tudor Popescu
2019-12-23 16:32 ` Jonah Graham
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox