[Bug remote/21106] New: Ctrl-C can not stop target during some file-IO
currygt52 at gmail dot com
sourceware-bugzilla@sourceware.org
Fri Feb 3 12:01:00 GMT 2017
https://sourceware.org/bugzilla/show_bug.cgi?id=21106
Bug ID: 21106
Summary: Ctrl-C can not stop target during some file-IO
Product: gdb
Version: HEAD
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: remote
Assignee: unassigned at sourceware dot org
Reporter: currygt52 at gmail dot com
Target Milestone: ---
Hi,
My program uses file-IO to output a large buffer.
I expect the pressed ctrl-c will stop the target during the WRITE file-IO.
gdb behaves differently according to different versions.
Current GDB on mainline will not stop target, bug previous GDB (7.11) will do
this.
Please help to check which is correct.
[Code]
#include <unistd.h>
#include <string.h>
#define SZ 4096000
char buf[SZ];
int main(void)
{
memset (buf, '1', SZ);
write (STDOUT_FILENO, buf, SZ);
return 0;
}
[version HEAD]
Sending packet: $m1daca8,800#23...Ack
^CPacket received: 313131...313131
Quit
Sending packet: $F-1,4#04...Ack
Packet received: Fclose,00000000
Sending packet: $F0#76...Ack
Packet received: Fclose,00000001
Sending packet: $F0#76...Ack
Packet received: W00
[Inferior 1 (Remote target) exited normally]
[version 7.11]
Sending packet: $ma34a8,800#92...Ack
Packet received: 313131...313131^CQuit
Sending packet: $F-1,4,C#73...Ack
Packet received: T02
Sending packet: $g#67...Ack
Packet received:
ffffffffb4ffff07080000000100000005000000dca3010000803e00b4ffff070000000000000000000000000000000000000000b0ffff07298900002884000073010020
Sending packet: $m8428,4#a3...Ack
Packet received: 0446631c
Sending packet: $qfThreadInfo#bb...Ack
Packet received: m1
Sending packet: $qsThreadInfo#c8...Ack
Packet received: l
Program received signal SIGINT, Interrupt.
0x00008428 in _write ()
(gdb) c
Continuing.
Sending packet: $vCont;c#a8...Ack
Packet received: Fclose,00000000
Sending packet: $F0#76...Ack
Packet received: Fclose,00000001
Sending packet: $F0#76...Ack
Packet received: W00
[Inferior 1 (Remote target) exited normally]
[Step to reproduce]
arm-none-eabi-gcc -O0 -g -mthumb -mcpu=cortex-m3 -specs=rdimon.specs -lrdimon
-o write write.c
qemu-system-arm -machine versatilepb -cpu cortex-m3 -nographic -semihosting
-kernel write -S -gdb tcp::8888
gdb) target remote :8888, press ctrl-c immediately after sending continue
command.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list