* gdb + remote qemu, Ctrl-C does not work
[not found] <AANLkTimvhnQs_4gTkaU_xfgjnm0G=Qkm-ZdzVYJ9nmfK@mail.gmail.com>
@ 2011-03-01 14:48 ` dpc
2011-03-01 18:35 ` Mike Frysinger
0 siblings, 1 reply; 15+ messages in thread
From: dpc @ 2011-03-01 14:48 UTC (permalink / raw)
To: gdb
Hi,
I have a little problem with arm-none-eabi-gdb that I'm debugging
remote qemu-system-arm targets.
The problem is: Ctrl-C does not break qemu target, but disconnects
qemu completely.
(gdb) c
Continuing.
^CRemote communication error. Target disconnected.: Connection reset by peer.
GDB is not offering me the Ctrl-C sequence to break execution (like my
native gdb does) so I guess I should use some different options
because what I know is (I've tried), that sending SIGINT to
arm-none-eabi-gdb process does break the execution. I see no reason
Ctrl-C could not work if sending SIGINT does.
I'm using default options and here are some relevant version strings:
$ arm-none-eabi-gdb --version
GNU gdb (Sourcery G++ Lite 2010.09-51) 7.2.50.20100908-cvs
$ uname -a
Linux mutex 2.6.35-27-generic #48-Ubuntu SMP Tue Feb 22 20:25:46 UTC
2011 x86_64 GNU/Linux
Much appreciated.
Regards,
Dawid
--
http://dpc.ucore.info
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-01 14:48 ` gdb + remote qemu, Ctrl-C does not work dpc
@ 2011-03-01 18:35 ` Mike Frysinger
2011-03-01 22:52 ` dpc
0 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2011-03-01 18:35 UTC (permalink / raw)
To: gdb; +Cc: dpc
[-- Attachment #1: Type: Text/Plain, Size: 444 bytes --]
On Tuesday, March 01, 2011 09:47:57 dpc@ucore.info wrote:
> I have a little problem with arm-none-eabi-gdb that I'm debugging
> remote qemu-system-arm targets.
>
> The problem is: Ctrl-C does not break qemu target, but disconnects
> qemu completely.
>
> (gdb) c
> Continuing.
> ^CRemote communication error. Target disconnected.: Connection reset by
> peer.
last i looked at this, it seemed like a qemu problem, not gdb
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-01 18:35 ` Mike Frysinger
@ 2011-03-01 22:52 ` dpc
2011-03-01 23:50 ` Mike Frysinger
0 siblings, 1 reply; 15+ messages in thread
From: dpc @ 2011-03-01 22:52 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb
On Tue, Mar 1, 2011 at 7:35 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Tuesday, March 01, 2011 09:47:57 dpc@ucore.info wrote:
>> I have a little problem with arm-none-eabi-gdb that I'm debugging
>> remote qemu-system-arm targets.
> last i looked at this, it seemed like a qemu problem, not gdb
> -mike
Clearly the gdb has some way to break gdb if sending SIGINT to gdb
works. Any way to emulate this on Ctrl-C?
--
http://dpc.ucore.info
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-01 22:52 ` dpc
@ 2011-03-01 23:50 ` Mike Frysinger
2011-03-02 7:29 ` dpc
0 siblings, 1 reply; 15+ messages in thread
From: Mike Frysinger @ 2011-03-01 23:50 UTC (permalink / raw)
To: dpc; +Cc: gdb
[-- Attachment #1: Type: Text/Plain, Size: 604 bytes --]
On Tuesday, March 01, 2011 17:52:29 dpc@ucore.info wrote:
> On Tue, Mar 1, 2011 at 7:35 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On Tuesday, March 01, 2011 09:47:57 dpc@ucore.info wrote:
> >> I have a little problem with arm-none-eabi-gdb that I'm debugging
> >> remote qemu-system-arm targets.
> >
> > last i looked at this, it seemed like a qemu problem, not gdb
>
> Clearly the gdb has some way to break gdb if sending SIGINT to gdb
> works.
if the remote stub does things wrong, there's nothing the gdb client should be
doing to work around it. fix the remote stub.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-01 23:50 ` Mike Frysinger
@ 2011-03-02 7:29 ` dpc
2011-03-02 9:45 ` Pedro Alves
2011-03-02 10:12 ` Andreas Schwab
0 siblings, 2 replies; 15+ messages in thread
From: dpc @ 2011-03-02 7:29 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb
On Wed, Mar 2, 2011 at 12:50 AM, Mike Frysinger <vapier@gentoo.org> wrote:
>> Clearly the gdb has some way to break gdb if sending SIGINT to gdb
>> works.
>
> if the remote stub does things wrong, there's nothing the gdb client should be
> doing to work around it. fix the remote stub.
That's the possibility as well. Someone / I could try fix qemu sources.
However I don't understand why gdb is doing something different on
SIGINT and something different on Ctrl-C.
--
http://dpc.ucore.info
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 7:29 ` dpc
@ 2011-03-02 9:45 ` Pedro Alves
2011-03-02 12:29 ` dpc
2011-03-02 10:12 ` Andreas Schwab
1 sibling, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2011-03-02 9:45 UTC (permalink / raw)
To: gdb; +Cc: dpc, Mike Frysinger
On Wednesday 02 March 2011 07:29:38, dpc@ucore.info wrote:
> That's the possibility as well. Someone / I could try fix qemu sources.
>
> However I don't understand why gdb is doing something different on
> SIGINT and something different on Ctrl-C.
Do you have qemu running on the same terminal as gdb?
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 7:29 ` dpc
2011-03-02 9:45 ` Pedro Alves
@ 2011-03-02 10:12 ` Andreas Schwab
1 sibling, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2011-03-02 10:12 UTC (permalink / raw)
To: dpc; +Cc: Mike Frysinger, gdb
"dpc@ucore.info" <dpc@ucore.info> writes:
> However I don't understand why gdb is doing something different on
> SIGINT and something different on Ctrl-C.
It's a matter of who receives the SIGINT. The action of Ctrl-C is
dependent on the terminal setting.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 9:45 ` Pedro Alves
@ 2011-03-02 12:29 ` dpc
2011-03-02 12:49 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: dpc @ 2011-03-02 12:29 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, Mike Frysinger
On Wed, Mar 2, 2011 at 10:45 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> Do you have qemu running on the same terminal as gdb?
Well yes, I guess. I'm running it in the same script like this:
qemu someoptions &
sleep 1
gdb -x somefile
--
http://dpc.ucore.info
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 12:29 ` dpc
@ 2011-03-02 12:49 ` Pedro Alves
2011-03-02 13:07 ` Tristan Gingold
0 siblings, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2011-03-02 12:49 UTC (permalink / raw)
To: dpc; +Cc: gdb, Mike Frysinger
On Wednesday 02 March 2011 12:29:40, dpc@ucore.info wrote:
> On Wed, Mar 2, 2011 at 10:45 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> > Do you have qemu running on the same terminal as gdb?
>
> Well yes, I guess. I'm running it in the same script like this:
>
> qemu someoptions &
> sleep 1
> gdb -x somefile
Your ctrl-c is reaching qemu as well, which is making it
commit suicide. Notice on your OP:
Continuing.
^CRemote communication error. Target disconnected.: Connection reset by peer.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This not a GDB problem.
I'd run qemu through a pipe ("target remote | qemu") instead
of using tcp.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 12:49 ` Pedro Alves
@ 2011-03-02 13:07 ` Tristan Gingold
2011-03-02 14:17 ` Pedro Alves
2011-03-02 14:26 ` dpc
0 siblings, 2 replies; 15+ messages in thread
From: Tristan Gingold @ 2011-03-02 13:07 UTC (permalink / raw)
To: Pedro Alves, dpc; +Cc: gdb, Mike Frysinger
On Mar 2, 2011, at 1:49 PM, Pedro Alves wrote:
> On Wednesday 02 March 2011 12:29:40, dpc@ucore.info wrote:
>> On Wed, Mar 2, 2011 at 10:45 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>>> Do you have qemu running on the same terminal as gdb?
>>
>> Well yes, I guess. I'm running it in the same script like this:
>>
>> qemu someoptions &
>> sleep 1
>> gdb -x somefile
>
> Your ctrl-c is reaching qemu as well, which is making it
> commit suicide.
Usually background processes don't get C-c.
> Notice on your OP:
>
> Continuing.
> ^CRemote communication error. Target disconnected.: Connection reset by peer.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IIRC we also had this issue. This was due to the fact that qemu exits before acking the packet.
Tristan.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 13:07 ` Tristan Gingold
@ 2011-03-02 14:17 ` Pedro Alves
2011-03-02 14:24 ` Tristan Gingold
2011-03-02 14:26 ` dpc
1 sibling, 1 reply; 15+ messages in thread
From: Pedro Alves @ 2011-03-02 14:17 UTC (permalink / raw)
To: gdb; +Cc: Tristan Gingold, dpc, Mike Frysinger
On Wednesday 02 March 2011 13:07:19, Tristan Gingold wrote:
> > Notice on your OP:
> >
> > Continuing.
> > ^CRemote communication error. Target disconnected.: Connection reset by peer.
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> IIRC we also had this issue. This was due to the fact that qemu exits before acking the packet.
>
I've seen that happen on a "quit/kill", due to the fact that
the 'k' packet (kill) does not require a reply.
But in this case, why would qemu exit at all before acking
the packet? This is about interrupting the target with ctrl-c, not
killing/quiting.
--
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 14:17 ` Pedro Alves
@ 2011-03-02 14:24 ` Tristan Gingold
0 siblings, 0 replies; 15+ messages in thread
From: Tristan Gingold @ 2011-03-02 14:24 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb, dpc, Mike Frysinger
On Mar 2, 2011, at 3:16 PM, Pedro Alves wrote:
> On Wednesday 02 March 2011 13:07:19, Tristan Gingold wrote:
>>> Notice on your OP:
>>>
>>> Continuing.
>>> ^CRemote communication error. Target disconnected.: Connection reset by peer.
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> IIRC we also had this issue. This was due to the fact that qemu exits before acking the packet.
>>
>
> I've seen that happen on a "quit/kill", due to the fact that
> the 'k' packet (kill) does not require a reply.
>
> But in this case, why would qemu exit at all before acking
> the packet? This is about interrupting the target with ctrl-c, not
> killing/quiting.
Right. Why I was so confused ? :-)
Tristan.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 13:07 ` Tristan Gingold
2011-03-02 14:17 ` Pedro Alves
@ 2011-03-02 14:26 ` dpc
2011-03-02 15:04 ` Joel Brobecker
1 sibling, 1 reply; 15+ messages in thread
From: dpc @ 2011-03-02 14:26 UTC (permalink / raw)
To: Tristan Gingold; +Cc: Pedro Alves, gdb, Mike Frysinger
On Wed, Mar 2, 2011 at 2:07 PM, Tristan Gingold <gingold@adacore.com> wrote:
>> Your ctrl-c is reaching qemu as well, which is making it
>> commit suicide.
>
> Usually background processes don't get C-c.
I am not sure, but I'd guess so. But what Pedro Alves says would
explained everything perfectly.
I'm planing to use internal bash "trap" command to handle ctrl-c myself.
But I'll try the trick with a pipe too.
--
http://dpc.ucore.info
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 14:26 ` dpc
@ 2011-03-02 15:04 ` Joel Brobecker
2011-03-02 16:12 ` Andreas Schwab
0 siblings, 1 reply; 15+ messages in thread
From: Joel Brobecker @ 2011-03-02 15:04 UTC (permalink / raw)
To: dpc; +Cc: Tristan Gingold, Pedro Alves, gdb, Mike Frysinger
> > Usually background processes don't get C-c.
>
> I am not sure, but I'd guess so. But what Pedro Alves says would
> explained everything perfectly.
That's only the case with interactive shells! In non-interactive
shell sessions (typically a script), background process are still
launched with the same process group as the parent script. Since
the SIGINT is propagated to all processes sharing the foreground
process group ID, this should explain why qemu is receiving the
SIGINT as well.
--
Joel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: gdb + remote qemu, Ctrl-C does not work
2011-03-02 15:04 ` Joel Brobecker
@ 2011-03-02 16:12 ` Andreas Schwab
0 siblings, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2011-03-02 16:12 UTC (permalink / raw)
To: Joel Brobecker; +Cc: dpc, Tristan Gingold, Pedro Alves, gdb, Mike Frysinger
Joel Brobecker <brobecker@adacore.com> writes:
> That's only the case with interactive shells! In non-interactive
> shell sessions (typically a script), background process are still
> launched with the same process group as the parent script.
This is not about interactive vs. non-interactive, but a matter of job
control. You can enable/disable job control independent of whether the
shell is interactive.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2011-03-02 16:12 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <AANLkTimvhnQs_4gTkaU_xfgjnm0G=Qkm-ZdzVYJ9nmfK@mail.gmail.com>
2011-03-01 14:48 ` gdb + remote qemu, Ctrl-C does not work dpc
2011-03-01 18:35 ` Mike Frysinger
2011-03-01 22:52 ` dpc
2011-03-01 23:50 ` Mike Frysinger
2011-03-02 7:29 ` dpc
2011-03-02 9:45 ` Pedro Alves
2011-03-02 12:29 ` dpc
2011-03-02 12:49 ` Pedro Alves
2011-03-02 13:07 ` Tristan Gingold
2011-03-02 14:17 ` Pedro Alves
2011-03-02 14:24 ` Tristan Gingold
2011-03-02 14:26 ` dpc
2011-03-02 15:04 ` Joel Brobecker
2011-03-02 16:12 ` Andreas Schwab
2011-03-02 10:12 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox