Community
Participate
Working Groups
There is a possibility that GDB will default the target-async setting to enabled, by default in the future, as proposed here: http://sourceware.org/ml/gdb-patches/2011-11/msg00763.html target-async was introduced in GDB 7.0 and allows to interact with GDB even while the inferior is running. DSF-GDB uses target-async on for non-stop mode, but not for all-stop. I'm pretty sure CDI does not change target-async at all, but needs it to be off. Until (and if) we decide to use target-async on for all-stop, it is safest to explicitly turn it off when we launch. This should be part of the cdt_8_0 branch just in case GDB goes ahead with the change in the near future.
Created attachment 208779 [details] Fix for DSF-GDB for master This patch creates a new FinalLaunchSequence_7_0 to handle non-stop and target-async, since the command to set target-async was not available before GDB 7.0. The patch also explicitly sets target-async to off in all-stop mode. This patch only addresses DSF-GDB. Committed to master.
Created attachment 208780 [details] Fix for DSF-GDB for cdt_8_0 This fix is for the cdt_8_0 branch. It is different to avoid adding new APIs. The solution is actually much simpler but more of a hack. I think it is still better than nothing so I have committed it to cdt_8_0.
Mikhail, can you review this fix? Also, do you have a recommendation for CDI? If GDB does set target-async on by default, I believe it will cause problems in CDI. A workaround is that the user will need to add set target-async off in their gdbinit file. Should we put a fix in CDI, or should we wait to see if it is needed? Is there an easy way to handle the fact that 'set target-async off' will fail for GDBs older than 7.0? Maybe using the commandFactory?
(In reply to comment #3) > Mikhail, can you review this fix? > The patch seems to be OK. > Also, do you have a recommendation for CDI? > If GDB does set target-async on by default, I believe it will cause problems in > CDI. > > A workaround is that the user will need to add > set target-async off > in their gdbinit file. > > Should we put a fix in CDI, or should we wait to see if it is needed? Is there > an easy way to handle the fact that 'set target-async off' will fail for GDBs > older than 7.0? Maybe using the commandFactory? I added 'set target-async on' to the current CDI launcher and it works fine. I don't see any differences from the previous non-async behavior.
(In reply to comment #4) > The patch seems to be OK. Thanks > I added 'set target-async on' to the current CDI launcher and it works fine. I > don't see any differences from the previous non-async behavior. Try interrupting a running thread. ^C won't work in async-mode.
(In reply to comment #5) > Try interrupting a running thread. ^C won't work in async-mode. Yes, that doesn't work. I think it would be enough just to turn the async mode off for all CDI sessions regardless of the GDB version.
^C might not work. -exec-interrupt does.
(In reply to comment #7) > ^C might not work. -exec-interrupt does. Thanks Vladimir. I'll look at it after holidays.
FAOD, -exec-interrupts works *only* in async mode. Also, re the topic, I think that async mode is generally OK these days. While non-stop requires specific per-target support to be fully robust, async mode is a host-side feature, with both Linux and Windows adequately supported.
Mikhail, do we want this fixed for CDI for Juno?
(In reply to comment #10) > Mikhail, do we want this fixed for CDI for Juno? I'll try.
Marc, this is fixed for DSF/GDB in 8.0.2, right? If so, we need to reassign it to DSF and close. To track the same issue fro CDI, I created a new bug - https://bugs.eclipse.org/bugs/show_bug.cgi?id=379043.
(In reply to comment #12) > Marc, this is fixed for DSF/GDB in 8.0.2, right? If so, we need to reassign it > to DSF and close. To track the same issue fro CDI, I created a new bug - > https://bugs.eclipse.org/bugs/show_bug.cgi?id=379043. Perfect! Thanks.