From 56cdbfff3e89a1eb61f0e9937c4daac94a698bd0 Mon Sep 17 00:00:00 2001 From: vprus Date: Sat, 23 Feb 2008 20:04:19 +0000 Subject: [PATCH] Unbreak 'target async'. * serial.c (serial_async): Set the handler function before enabling async mode. --- gdb/ChangeLog | 7 +++++++ gdb/serial.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 05896bef9a..1af57618e4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2008-02-23 Vladimir Prus + + Unbreak 'target async'. + * serial.c (serial_async): Set the + handler function before enabling async + mode. + 2008-02-22 Daniel Jacobowitz * solib-svr4.c (enable_break): Convert r_brk to a code address. diff --git a/gdb/serial.c b/gdb/serial.c index 7bdf170fcd..1fb7f31a55 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -515,12 +515,12 @@ serial_async (struct serial *scb, serial_event_ftype *handler, void *context) { - /* Only change mode if there is a need. */ - if ((scb->async_handler == NULL) - != (handler == NULL)) - scb->ops->async (scb, handler != NULL); + int changed = ((scb->async_handler == NULL) != (handler == NULL)); scb->async_handler = handler; scb->async_context = context; + /* Only change mode if there is a need. */ + if (changed) + scb->ops->async (scb, handler != NULL); } int -- 2.11.0