Re: Include putpkt in TRY_CATCH. PR gdb/15275

Jan Kratochvil
2013-03-29T14:03:02Z

On Thu, 28 Mar 2013 18:07:10 +0100, Pedro Alves wrote:
> And detaching should
> delete breakpoints from the target before sending "D" (although detach
> command does, a detach caused by "quit" doesn't (if you "gdbserver --attach",

I see it working:

#0 remote_remove_breakpoint at remote.c:8113
#1 in target_remove_breakpoint at target.c:2462
#2 in bkpt_remove_location at breakpoint.c:12983
#3 in remove_breakpoint_1 at breakpoint.c:3590
#4 in remove_breakpoint at breakpoint.c:3696
#5 in remove_breakpoints_pid at breakpoint.c:2955
#6 in target_detach at target.c:2595
#7 in kill_or_detach at top.c:1212
#8 in iterate_over_inferiors at inferior.c:395
#9 in quit_target at top.c:1293
#10 in catch_errors at exceptions.c:546
#11 in quit_force at top.c:1331
#12 in quit_command at ./cli/cli-cmds.c:327

> "quit" will offer to detach instead of kill), and that's a bug...)),

It will but I do not see where is a bug:
(gdb) q
A debugging session is active.
Inferior 1 [process 11571] will be detached.
Quit anyway? (y or n) y

> gdb/
> 2013-03-28 Pedro Alves <palves@redhat.com>
>
> PR gdb/15275
>
> * remote.c (send_interrupt_sequence): Use remote_serial_write.
> (remote_serial_write): New function.
> (putpkt_binary, getpkt_or_notif_sane_1): Use remote_serial_write.

I agree this fix is better. I will revert the previous check-in after this
check-in.

Thanks,
Jan