From 986a2998932e978e63fc3b7ead1fef81f7aad52e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 7 Jul 2013 13:05:05 +0200 Subject: gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids polluting the global namespace with a non-prefixed macro and makes it obvious in the call sites that we return. Semi-automatic conversion using, e.g., sed -i 's/GET_REGL(/return gdb_get_regl(mem_buf, /g' target-*/gdbstub.c followed by manual tweaking for sparc's GET_REGA() and Coding Style. Acked-by: Michael Walle (for lm32) Acked-by: Max Filippov (for xtensa) Signed-off-by: Andreas Färber --- target-ppc/gdbstub.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'target-ppc/gdbstub.c') diff --git a/target-ppc/gdbstub.c b/target-ppc/gdbstub.c index b834e60f54..40a9d7b6d4 100644 --- a/target-ppc/gdbstub.c +++ b/target-ppc/gdbstub.c @@ -29,7 +29,7 @@ static int cpu_gdb_read_register(CPUPPCState *env, uint8_t *mem_buf, int n) { if (n < 32) { /* gprs */ - GET_REGL(env->gpr[n]); + return gdb_get_regl(mem_buf, env->gpr[n]); } else if (n < 64) { /* fprs */ if (gdb_has_xml) { @@ -40,9 +40,9 @@ static int cpu_gdb_read_register(CPUPPCState *env, uint8_t *mem_buf, int n) } else { switch (n) { case 64: - GET_REGL(env->nip); + return gdb_get_regl(mem_buf, env->nip); case 65: - GET_REGL(env->msr); + return gdb_get_regl(mem_buf, env->msr); case 66: { uint32_t cr = 0; @@ -50,20 +50,20 @@ static int cpu_gdb_read_register(CPUPPCState *env, uint8_t *mem_buf, int n) for (i = 0; i < 8; i++) { cr |= env->crf[i] << (32 - ((i + 1) * 4)); } - GET_REG32(cr); + return gdb_get_reg32(mem_buf, cr); } case 67: - GET_REGL(env->lr); + return gdb_get_regl(mem_buf, env->lr); case 68: - GET_REGL(env->ctr); + return gdb_get_regl(mem_buf, env->ctr); case 69: - GET_REGL(env->xer); + return gdb_get_regl(mem_buf, env->xer); case 70: { if (gdb_has_xml) { return 0; } - GET_REG32(env->fpscr); + return gdb_get_reg32(mem_buf, env->fpscr); } } } -- cgit v1.2.1