aboutsummaryrefslogtreecommitdiff
path: root/target/m68k/gdbstub.c
diff options
context:
space:
mode:
Diffstat (limited to 'target/m68k/gdbstub.c')
-rw-r--r--target/m68k/gdbstub.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/target/m68k/gdbstub.c b/target/m68k/gdbstub.c
index 99e5be8132..15547e2313 100644
--- a/target/m68k/gdbstub.c
+++ b/target/m68k/gdbstub.c
@@ -7,7 +7,7 @@
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,14 +18,12 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu/osdep.h"
-#include "qemu-common.h"
#include "cpu.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/helpers.h"
-int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
+int m68k_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
{
- M68kCPU *cpu = M68K_CPU(cs);
- CPUM68KState *env = &cpu->env;
+ CPUM68KState *env = cpu_env(cs);
if (n < 8) {
/* D0-D7 */
@@ -36,20 +34,22 @@ int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
} else {
switch (n) {
case 16:
- return gdb_get_reg32(mem_buf, env->sr);
+ /* SR is made of SR+CCR, CCR is many 1bit flags so uses helper */
+ return gdb_get_reg32(mem_buf, env->sr | cpu_m68k_get_ccr(env));
case 17:
return gdb_get_reg32(mem_buf, env->pc);
}
}
- /* FP registers not included here because they vary between
- ColdFire and m68k. Use XML bits for these. */
+ /*
+ * FP registers not included here because they vary between
+ * ColdFire and m68k. Use XML bits for these.
+ */
return 0;
}
int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
{
- M68kCPU *cpu = M68K_CPU(cs);
- CPUM68KState *env = &cpu->env;
+ CPUM68KState *env = cpu_env(cs);
uint32_t tmp;
tmp = ldl_p(mem_buf);