[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu v2 08/42] gdbstub: Update gdb_handlesig() an
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu v2 08/42] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style |
Date: |
Sun, 7 Jul 2013 20:25:57 +0200 |
In particular reindent to 4 instead of 2 spaces.
Prepares for changing cpu_single_step() argument in gdb_handlesig().
Signed-off-by: Andreas Färber <address@hidden>
---
gdbstub.c | 94 +++++++++++++++++++++++++++++++--------------------------------
1 file changed, 47 insertions(+), 47 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 07838eb..ede5cb1 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -2759,66 +2759,66 @@ gdb_queuesig (void)
}
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;
- s = gdbserver_state;
- if (gdbserver_fd < 0 || s->fd < 0)
- return sig;
+ s = gdbserver_state;
+ if (gdbserver_fd < 0 || s->fd < 0) {
+ return sig;
+ }
- /* 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);
- if (sig != 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;
-
- sig = 0;
- s->state = RS_IDLE;
- s->running_state = 0;
- while (s->running_state == 0) {
- n = read (s->fd, buf, 256);
- if (n > 0)
- {
- int i;
+ if (sig != 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;
+ }
- for (i = 0; i < n; i++)
- gdb_read_byte (s, buf[i]);
- }
- else if (n == 0 || errno != EAGAIN)
- {
- /* XXX: Connection closed. Should probably wait for another
- connection before continuing. */
- return sig;
+ sig = 0;
+ s->state = RS_IDLE;
+ s->running_state = 0;
+ while (s->running_state == 0) {
+ n = read(s->fd, buf, 256);
+ if (n > 0) {
+ int i;
+
+ for (i = 0; i < n; i++) {
+ gdb_read_byte(s, buf[i]);
+ }
+ } else if (n == 0 || errno != EAGAIN) {
+ /* XXX: Connection closed. Should probably wait for another
+ connection before continuing. */
+ return sig;
}
- }
- sig = s->signal;
- s->signal = 0;
- return sig;
+ }
+ sig = s->signal;
+ s->signal = 0;
+ return sig;
}
/* 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];
- s = gdbserver_state;
- if (gdbserver_fd < 0 || s->fd < 0)
- return;
+ s = gdbserver_state;
+ if (gdbserver_fd < 0 || s->fd < 0) {
+ return;
+ }
- 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);
}
static void gdb_accept(void)
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu v2 00/42] QOM CPUState, part 11: GDB stub, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 01/42] cpu: Introduce vaddr type, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 04/42] target-moxie: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 03/42] target-m68k: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 05/42] target-unicore32: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 02/42] cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 08/42] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu v2 09/42] cpu: Change cpu_single_step() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 11/42] gdbstub: Change syscall callback argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 10/42] kvm: Change kvm_{insert, remove}_breakpoint() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 06/42] cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 14/42] gdbstub: Change gdb_{read, write}_register() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 13/42] gdbstub: Change GDBState::c_cpu to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 12/42] gdbstub: Change gdb_handlesig() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 18/42] gdbstub: Change GDBState::g_cpu to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 07/42] cpu: Move singlestep_enabled field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 19/42] cpu: Move gdb_regs field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/07