aboutsummaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-07-07 13:05:05 +0200
committerAndreas Färber <afaerber@suse.de>2013-07-27 00:04:17 +0200
commit986a2998932e978e63fc3b7ead1fef81f7aad52e (patch)
tree93d84a9f6c46c1bd4a9d98d9c9463ed276ca4260 /target-i386
parent25d8ac0e31c3c68dfdd6da7c33b87870b4a3b623 (diff)
downloadqemu-986a2998932e978e63fc3b7ead1fef81f7aad52e.zip
qemu-986a2998932e978e63fc3b7ead1fef81f7aad52e.tar.gz
qemu-986a2998932e978e63fc3b7ead1fef81f7aad52e.tar.bz2
gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions
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 <michael@walle.cc> (for lm32) Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa) Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/gdbstub.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/target-i386/gdbstub.c b/target-i386/gdbstub.c
index 974d8ad..0a4d97d 100644
--- a/target-i386/gdbstub.c
+++ b/target-i386/gdbstub.c
@@ -39,9 +39,9 @@ static int cpu_gdb_read_register(CPUX86State *env, uint8_t *mem_buf, int n)
{
if (n < CPU_NB_REGS) {
if (TARGET_LONG_BITS == 64 && env->hflags & HF_CS64_MASK) {
- GET_REG64(env->regs[gpr_map[n]]);
+ return gdb_get_reg64(mem_buf, env->regs[gpr_map[n]]);
} else if (n < CPU_NB_REGS32) {
- GET_REG32(env->regs[gpr_map32[n]]);
+ return gdb_get_reg32(mem_buf, env->regs[gpr_map32[n]]);
}
} else if (n >= IDX_FP_REGS && n < IDX_FP_REGS + 8) {
#ifdef USE_X86LDOUBLE
@@ -63,46 +63,46 @@ static int cpu_gdb_read_register(CPUX86State *env, uint8_t *mem_buf, int n)
switch (n) {
case IDX_IP_REG:
if (TARGET_LONG_BITS == 64 && env->hflags & HF_CS64_MASK) {
- GET_REG64(env->eip);
+ return gdb_get_reg64(mem_buf, env->eip);
} else {
- GET_REG32(env->eip);
+ return gdb_get_reg32(mem_buf, env->eip);
}
case IDX_FLAGS_REG:
- GET_REG32(env->eflags);
+ return gdb_get_reg32(mem_buf, env->eflags);
case IDX_SEG_REGS:
- GET_REG32(env->segs[R_CS].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_CS].selector);
case IDX_SEG_REGS + 1:
- GET_REG32(env->segs[R_SS].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_SS].selector);
case IDX_SEG_REGS + 2:
- GET_REG32(env->segs[R_DS].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_DS].selector);
case IDX_SEG_REGS + 3:
- GET_REG32(env->segs[R_ES].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_ES].selector);
case IDX_SEG_REGS + 4:
- GET_REG32(env->segs[R_FS].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_FS].selector);
case IDX_SEG_REGS + 5:
- GET_REG32(env->segs[R_GS].selector);
+ return gdb_get_reg32(mem_buf, env->segs[R_GS].selector);
case IDX_FP_REGS + 8:
- GET_REG32(env->fpuc);
+ return gdb_get_reg32(mem_buf, env->fpuc);
case IDX_FP_REGS + 9:
- GET_REG32((env->fpus & ~0x3800) |
- (env->fpstt & 0x7) << 11);
+ return gdb_get_reg32(mem_buf, (env->fpus & ~0x3800) |
+ (env->fpstt & 0x7) << 11);
case IDX_FP_REGS + 10:
- GET_REG32(0); /* ftag */
+ return gdb_get_reg32(mem_buf, 0); /* ftag */
case IDX_FP_REGS + 11:
- GET_REG32(0); /* fiseg */
+ return gdb_get_reg32(mem_buf, 0); /* fiseg */
case IDX_FP_REGS + 12:
- GET_REG32(0); /* fioff */
+ return gdb_get_reg32(mem_buf, 0); /* fioff */
case IDX_FP_REGS + 13:
- GET_REG32(0); /* foseg */
+ return gdb_get_reg32(mem_buf, 0); /* foseg */
case IDX_FP_REGS + 14:
- GET_REG32(0); /* fooff */
+ return gdb_get_reg32(mem_buf, 0); /* fooff */
case IDX_FP_REGS + 15:
- GET_REG32(0); /* fop */
+ return gdb_get_reg32(mem_buf, 0); /* fop */
case IDX_MXCSR_REG:
- GET_REG32(env->mxcsr);
+ return gdb_get_reg32(mem_buf, env->mxcsr);
}
}
return 0;