Received: from eggs.gnu.org ([2001:4830:134:3::10]:37279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwgKc-0001rp-5B for qemu-devel@nongnu.org; Tue, 09 Jul 2013 18:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwgKa-0002J9-So for qemu-devel@nongnu.org; Tue, 09 Jul 2013 18:24:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:32961 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwgKZ-0002Ik-V1 for qemu-devel@nongnu.org; Tue, 09 Jul 2013 18:24:20 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 69E3AA531D for ; Wed, 10 Jul 2013 00:24:19 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 10 Jul 2013 00:23:27 +0200 Message-Id: <1373408640-6046-9-git-send-email-afaerber@suse.de> In-Reply-To: <1373408640-6046-1-git-send-email-afaerber@suse.de> References: <1373408640-6046-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu v3 08/41] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= In particular reindent to 4 instead of 2 spaces. Prepares for changing cpu_single_step() argument in gdb_handlesig(). Signed-off-by: Andreas F=C3=A4rber --- gdbstub.c | 94 +++++++++++++++++++++++++++++++--------------------------= ------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 55d4756..6ddff91 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2761,66 +2761,66 @@ gdb_queuesig (void) } =20 int -gdb_handlesig (CPUArchState *env, int sig) +gdb_handlesig(CPUArchState *env, int sig) { - GDBState *s; - char buf[256]; - int n; + GDBState *s; + char buf[256]; + int n; =20 - s =3D gdbserver_state; - if (gdbserver_fd < 0 || s->fd < 0) - return sig; + s =3D gdbserver_state; + if (gdbserver_fd < 0 || s->fd < 0) { + return sig; + } =20 - /* disable single step if it was enabled */ - cpu_single_step(env, 0); - tb_flush(env); + /* disable single step if it was enabled */ + cpu_single_step(env, 0); + tb_flush(env); =20 - if (sig !=3D 0) - { - snprintf(buf, sizeof(buf), "S%02x", target_signal_to_gdb (sig)); - put_packet(s, buf); - } - /* put_packet() might have detected that the peer terminated the=20 - connection. */ - if (s->fd < 0) - return sig; - - sig =3D 0; - s->state =3D RS_IDLE; - s->running_state =3D 0; - while (s->running_state =3D=3D 0) { - n =3D read (s->fd, buf, 256); - if (n > 0) - { - int i; + if (sig !=3D 0) { + snprintf(buf, sizeof(buf), "S%02x", target_signal_to_gdb(sig)); + put_packet(s, buf); + } + /* put_packet() might have detected that the peer terminated the + connection. */ + if (s->fd < 0) { + return sig; + } =20 - for (i =3D 0; i < n; i++) - gdb_read_byte (s, buf[i]); - } - else if (n =3D=3D 0 || errno !=3D EAGAIN) - { - /* XXX: Connection closed. Should probably wait for another - connection before continuing. */ - return sig; + sig =3D 0; + s->state =3D RS_IDLE; + s->running_state =3D 0; + while (s->running_state =3D=3D 0) { + n =3D read(s->fd, buf, 256); + if (n > 0) { + int i; + + for (i =3D 0; i < n; i++) { + gdb_read_byte(s, buf[i]); + } + } else if (n =3D=3D 0 || errno !=3D EAGAIN) { + /* XXX: Connection closed. Should probably wait for another + connection before continuing. */ + return sig; } - } - sig =3D s->signal; - s->signal =3D 0; - return sig; + } + sig =3D s->signal; + s->signal =3D 0; + return sig; } =20 /* Tell the remote gdb that the process has exited due to SIG. */ void gdb_signalled(CPUArchState *env, int sig) { - GDBState *s; - char buf[4]; + GDBState *s; + char buf[4]; =20 - s =3D gdbserver_state; - if (gdbserver_fd < 0 || s->fd < 0) - return; + s =3D gdbserver_state; + if (gdbserver_fd < 0 || s->fd < 0) { + return; + } =20 - snprintf(buf, sizeof(buf), "X%02x", target_signal_to_gdb (sig)); - put_packet(s, buf); + snprintf(buf, sizeof(buf), "X%02x", target_signal_to_gdb(sig)); + put_packet(s, buf); } =20 static void gdb_accept(void) --=20 1.8.1.4