Revision 5b50e790

b/gdbstub.c
40 40
#include "cpu.h"
41 41
#include "qemu/sockets.h"
42 42
#include "sysemu/kvm.h"
43
#include "qemu/bitops.h"
44 43

  
45 44
static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr,
46 45
                                         uint8_t *buf, int len, bool is_write)
......
316 315

  
317 316
static GDBState *gdbserver_state;
318 317

  
319
/* This is an ugly hack to cope with both new and old gdb.
320
   If gdb sends qXfer:features:read then assume we're talking to a newish
321
   gdb that understands target descriptions.  */
322
static int gdb_has_xml;
318
bool gdb_has_xml;
323 319

  
324 320
#ifdef CONFIG_USER_ONLY
325 321
/* XXX: This is not thread safe.  Do we care?  */
......
489 485
    return put_packet_binary(s, buf, strlen(buf));
490 486
}
491 487

  
492
#if defined(TARGET_I386)
493

  
494
#include "target-i386/gdbstub.c"
495

  
496
#elif defined (TARGET_PPC)
488
#if defined(TARGET_PPC)
497 489

  
498 490
#if defined (TARGET_PPC64)
499 491
#define GDB_CORE_XML "power64-core.xml"
......
501 493
#define GDB_CORE_XML "power-core.xml"
502 494
#endif
503 495

  
504
#include "target-ppc/gdbstub.c"
505

  
506
#elif defined (TARGET_SPARC)
507

  
508
#include "target-sparc/gdbstub.c"
509

  
510 496
#elif defined (TARGET_ARM)
511 497

  
512 498
#define GDB_CORE_XML "arm-core.xml"
513 499

  
514
#include "target-arm/gdbstub.c"
515

  
516 500
#elif defined (TARGET_M68K)
517 501

  
518 502
#define GDB_CORE_XML "cf-core.xml"
519 503

  
520
#include "target-m68k/gdbstub.c"
521

  
522
#elif defined (TARGET_MIPS)
523

  
524
#include "target-mips/gdbstub.c"
525

  
526
#elif defined(TARGET_OPENRISC)
527

  
528
#include "target-openrisc/gdbstub.c"
529

  
530
#elif defined (TARGET_SH4)
531

  
532
#include "target-sh4/gdbstub.c"
533

  
534
#elif defined (TARGET_MICROBLAZE)
535

  
536
#include "target-microblaze/gdbstub.c"
537

  
538
#elif defined (TARGET_CRIS)
539

  
540
#include "target-cris/gdbstub.c"
541

  
542
#elif defined (TARGET_ALPHA)
543

  
544
#include "target-alpha/gdbstub.c"
545

  
546
#elif defined (TARGET_S390X)
547

  
548
#include "target-s390x/gdbstub.c"
549

  
550
#elif defined (TARGET_LM32)
551

  
552
#include "target-lm32/gdbstub.c"
553

  
554
#elif defined(TARGET_XTENSA)
555

  
556
#include "target-xtensa/gdbstub.c"
557

  
558
#else
559

  
560
static int cpu_gdb_read_register(CPUArchState *env, uint8_t *mem_buf, int n)
561
{
562
    return 0;
563
}
564

  
565
static int cpu_gdb_write_register(CPUArchState *env, uint8_t *mem_buf, int n)
566
{
567
    return 0;
568
}
569

  
570 504
#endif
571 505

  
572 506
#ifdef GDB_CORE_XML
......
642 576
    GDBRegisterState *r;
643 577

  
644 578
    if (reg < cc->gdb_num_core_regs) {
645
        return cpu_gdb_read_register(env, mem_buf, reg);
579
        return cc->gdb_read_register(cpu, mem_buf, reg);
646 580
    }
647 581

  
648 582
    for (r = cpu->gdb_regs; r; r = r->next) {
......
660 594
    GDBRegisterState *r;
661 595

  
662 596
    if (reg < cc->gdb_num_core_regs) {
663
        return cpu_gdb_write_register(env, mem_buf, reg);
597
        return cc->gdb_write_register(cpu, mem_buf, reg);
664 598
    }
665 599

  
666 600
    for (r = cpu->gdb_regs; r; r = r->next) {
......
1212 1146
            const char *xml;
1213 1147
            target_ulong total_len;
1214 1148

  
1215
            gdb_has_xml = 1;
1149
            gdb_has_xml = true;
1216 1150
            p += 19;
1217 1151
            xml = get_feature_xml(p, &p);
1218 1152
            if (!xml) {
......
1621 1555
    s->c_cpu = first_cpu;
1622 1556
    s->g_cpu = first_cpu;
1623 1557
    s->fd = fd;
1624
    gdb_has_xml = 0;
1558
    gdb_has_xml = false;
1625 1559

  
1626 1560
    gdbserver_state = s;
1627 1561

  
......
1707 1641
    switch (event) {
1708 1642
    case CHR_EVENT_OPENED:
1709 1643
        vm_stop(RUN_STATE_PAUSED);
1710
        gdb_has_xml = 0;
1644
        gdb_has_xml = false;
1711 1645
        break;
1712 1646
    default:
1713 1647
        break;
b/include/exec/gdbstub.h
84 84
int gdbserver_start(const char *port);
85 85
#endif
86 86

  
87
/**
88
 * gdb_has_xml:
89
 * This is an ugly hack to cope with both new and old gdb.
90
 * If gdb sends qXfer:features:read then assume we're talking to a newish
91
 * gdb that understands target descriptions.
92
 */
93
extern bool gdb_has_xml;
94

  
87 95
/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */
88 96
extern const char *const xml_builtin[][2];
89 97

  
b/include/qom/cpu.h
80 80
 * @synchronize_from_tb: Callback for synchronizing state from a TCG
81 81
 * #TranslationBlock.
82 82
 * @get_phys_page_debug: Callback for obtaining a physical address.
83
 * @gdb_read_register: Callback for letting GDB read a register.
84
 * @gdb_write_register: Callback for letting GDB write a register.
83 85
 * @vmsd: State description for migration.
84 86
 * @gdb_num_core_regs: Number of core registers accessible to GDB.
85 87
 *
......
109 111
    void (*set_pc)(CPUState *cpu, vaddr value);
110 112
    void (*synchronize_from_tb)(CPUState *cpu, struct TranslationBlock *tb);
111 113
    hwaddr (*get_phys_page_debug)(CPUState *cpu, vaddr addr);
114
    int (*gdb_read_register)(CPUState *cpu, uint8_t *buf, int reg);
115
    int (*gdb_write_register)(CPUState *cpu, uint8_t *buf, int reg);
112 116

  
113 117
    int (*write_elf64_note)(WriteCoreDumpFunction f, CPUState *cpu,
114 118
                            int cpuid, void *opaque);
b/qom/cpu.c
157 157
}
158 158

  
159 159

  
160
static int cpu_common_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg)
161
{
162
    return 0;
163
}
164

  
165
static int cpu_common_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg)
166
{
167
    return 0;
168
}
169

  
170

  
160 171
void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
161 172
                    int flags)
162 173
{
......
253 264
    k->write_elf32_note = cpu_common_write_elf32_note;
254 265
    k->write_elf64_qemunote = cpu_common_write_elf64_qemunote;
255 266
    k->write_elf64_note = cpu_common_write_elf64_note;
267
    k->gdb_read_register = cpu_common_gdb_read_register;
268
    k->gdb_write_register = cpu_common_gdb_write_register;
256 269
    dc->realize = cpu_common_realizefn;
257 270
    dc->no_user = 1;
258 271
}
b/target-alpha/Makefile.objs
1 1
obj-$(CONFIG_SOFTMMU) += machine.o
2 2
obj-y += translate.o helper.o cpu.o
3 3
obj-y += int_helper.o fpu_helper.o sys_helper.o mem_helper.o
4
obj-y += gdbstub.o
b/target-alpha/cpu-qom.h
82 82
void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
83 83
                          int flags);
84 84
hwaddr alpha_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
85
int alpha_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
86
int alpha_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
85 87

  
86 88
#endif
b/target-alpha/cpu.c
271 271
    cc->do_interrupt = alpha_cpu_do_interrupt;
272 272
    cc->dump_state = alpha_cpu_dump_state;
273 273
    cc->set_pc = alpha_cpu_set_pc;
274
    cc->gdb_read_register = alpha_cpu_gdb_read_register;
275
    cc->gdb_write_register = alpha_cpu_gdb_write_register;
274 276
#ifndef CONFIG_USER_ONLY
275 277
    cc->do_unassigned_access = alpha_cpu_unassigned_access;
276 278
    cc->get_phys_page_debug = alpha_cpu_get_phys_page_debug;
b/target-alpha/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUAlphaState *env, uint8_t *mem_buf, int n)
24
int alpha_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    AlphaCPU *cpu = ALPHA_CPU(cs);
27
    CPUAlphaState *env = &cpu->env;
23 28
    uint64_t val;
24 29
    CPU_DoubleU d;
25 30

  
......
52 57
    return gdb_get_regl(mem_buf, val);
53 58
}
54 59

  
55
static int cpu_gdb_write_register(CPUAlphaState *env, uint8_t *mem_buf, int n)
60
int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
56 61
{
62
    AlphaCPU *cpu = ALPHA_CPU(cs);
63
    CPUAlphaState *env = &cpu->env;
57 64
    target_ulong tmp = ldtul_p(mem_buf);
58 65
    CPU_DoubleU d;
59 66

  
b/target-arm/Makefile.objs
4 4
obj-$(CONFIG_NO_KVM) += kvm-stub.o
5 5
obj-y += translate.o op_helper.o helper.o cpu.o
6 6
obj-y += neon_helper.o iwmmxt_helper.o
7
obj-y += gdbstub.o
b/target-arm/cpu-qom.h
149 149

  
150 150
hwaddr arm_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
151 151

  
152
int arm_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
153
int arm_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
154

  
152 155
#endif
b/target-arm/cpu.c
824 824
    cc->do_interrupt = arm_cpu_do_interrupt;
825 825
    cc->dump_state = arm_cpu_dump_state;
826 826
    cc->set_pc = arm_cpu_set_pc;
827
    cc->gdb_read_register = arm_cpu_gdb_read_register;
828
    cc->gdb_write_register = arm_cpu_gdb_write_register;
827 829
#ifndef CONFIG_USER_ONLY
828 830
    cc->get_phys_page_debug = arm_cpu_get_phys_page_debug;
829 831
    cc->vmsd = &vmstate_arm_cpu;
b/target-arm/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
/* Old gdb always expect FPA registers.  Newer (xml-aware) gdb only expect
22 25
   whatever the target description contains.  Due to a historical mishap
......
24 27
   We hack round this by giving the FPA regs zero size when talking to a
25 28
   newer gdb.  */
26 29

  
27
static int cpu_gdb_read_register(CPUARMState *env, uint8_t *mem_buf, int n)
30
int arm_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
28 31
{
32
    ARMCPU *cpu = ARM_CPU(cs);
33
    CPUARMState *env = &cpu->env;
34

  
29 35
    if (n < 16) {
30 36
        /* Core integer register.  */
31 37
        return gdb_get_reg32(mem_buf, env->regs[n]);
......
53 59
    return 0;
54 60
}
55 61

  
56
static int cpu_gdb_write_register(CPUARMState *env, uint8_t *mem_buf, int n)
62
int arm_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
57 63
{
64
    ARMCPU *cpu = ARM_CPU(cs);
65
    CPUARMState *env = &cpu->env;
58 66
    uint32_t tmp;
59 67

  
60 68
    tmp = ldl_p(mem_buf);
b/target-cris/Makefile.objs
1 1
obj-y += translate.o op_helper.o helper.o cpu.o
2
obj-y += gdbstub.o
2 3
obj-$(CONFIG_SOFTMMU) += mmu.o machine.o
b/target-cris/cpu-qom.h
81 81

  
82 82
hwaddr cris_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
83 83

  
84
int cris_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
85
int cris_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
86

  
84 87
#endif
b/target-cris/cpu.c
255 255
    cc->do_interrupt = cris_cpu_do_interrupt;
256 256
    cc->dump_state = cris_cpu_dump_state;
257 257
    cc->set_pc = cris_cpu_set_pc;
258
    cc->gdb_read_register = cris_cpu_gdb_read_register;
259
    cc->gdb_write_register = cris_cpu_gdb_write_register;
258 260
#ifndef CONFIG_USER_ONLY
259 261
    cc->get_phys_page_debug = cris_cpu_get_phys_page_debug;
260 262
#endif
b/target-cris/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
static int
22 25
read_register_crisv10(CPUCRISState *env, uint8_t *mem_buf, int n)
......
48 51
    return 0;
49 52
}
50 53

  
51
static int cpu_gdb_read_register(CPUCRISState *env, uint8_t *mem_buf, int n)
54
int cris_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
52 55
{
56
    CRISCPU *cpu = CRIS_CPU(cs);
57
    CPUCRISState *env = &cpu->env;
53 58
    uint8_t srs;
54 59

  
55 60
    if (env->pregs[PR_VR] < 32) {
......
85 90
    return 0;
86 91
}
87 92

  
88
static int cpu_gdb_write_register(CPUCRISState *env, uint8_t *mem_buf, int n)
93
int cris_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
89 94
{
95
    CRISCPU *cpu = CRIS_CPU(cs);
96
    CPUCRISState *env = &cpu->env;
90 97
    uint32_t tmp;
91 98

  
92 99
    if (n > 49) {
b/target-i386/Makefile.objs
1 1
obj-y += translate.o helper.o cpu.o
2 2
obj-y += excp_helper.o fpu_helper.o cc_helper.o int_helper.o svm_helper.o
3 3
obj-y += smm_helper.o misc_helper.o mem_helper.o seg_helper.o
4
obj-y += gdbstub.o
4 5
obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o
5 6
obj-$(CONFIG_KVM) += kvm.o hyperv.o
6 7
obj-$(CONFIG_NO_KVM) += kvm-stub.o
b/target-i386/cpu-qom.h
106 106

  
107 107
hwaddr x86_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
108 108

  
109
int x86_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
110
int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
111

  
109 112
#endif
b/target-i386/cpu.c
2538 2538
    cc->dump_state = x86_cpu_dump_state;
2539 2539
    cc->set_pc = x86_cpu_set_pc;
2540 2540
    cc->synchronize_from_tb = x86_cpu_synchronize_from_tb;
2541
    cc->gdb_read_register = x86_cpu_gdb_read_register;
2542
    cc->gdb_write_register = x86_cpu_gdb_write_register;
2541 2543
    cc->get_arch_id = x86_cpu_get_arch_id;
2542 2544
    cc->get_paging_enabled = x86_cpu_get_paging_enabled;
2543 2545
#ifndef CONFIG_USER_ONLY
b/target-i386/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
#ifdef TARGET_X86_64
22 25
static const int gpr_map[16] = {
......
35 38
#define IDX_XMM_REGS    (IDX_FP_REGS + 16)
36 39
#define IDX_MXCSR_REG   (IDX_XMM_REGS + CPU_NB_REGS)
37 40

  
38
static int cpu_gdb_read_register(CPUX86State *env, uint8_t *mem_buf, int n)
41
int x86_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
39 42
{
43
    X86CPU *cpu = X86_CPU(cs);
44
    CPUX86State *env = &cpu->env;
45

  
40 46
    if (n < CPU_NB_REGS) {
41 47
        if (TARGET_LONG_BITS == 64 && env->hflags & HF_CS64_MASK) {
42 48
            return gdb_get_reg64(mem_buf, env->regs[gpr_map[n]]);
......
108 114
    return 0;
109 115
}
110 116

  
111
static int cpu_x86_gdb_load_seg(CPUX86State *env, int sreg, uint8_t *mem_buf)
117
static int x86_cpu_gdb_load_seg(X86CPU *cpu, int sreg, uint8_t *mem_buf)
112 118
{
119
    CPUX86State *env = &cpu->env;
113 120
    uint16_t selector = ldl_p(mem_buf);
114 121

  
115 122
    if (selector != env->segs[sreg].selector) {
......
135 142
    return 4;
136 143
}
137 144

  
138
static int cpu_gdb_write_register(CPUX86State *env, uint8_t *mem_buf, int n)
145
int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
139 146
{
147
    X86CPU *cpu = X86_CPU(cs);
148
    CPUX86State *env = &cpu->env;
140 149
    uint32_t tmp;
141 150

  
142 151
    if (n < CPU_NB_REGS) {
......
179 188
            return 4;
180 189

  
181 190
        case IDX_SEG_REGS:
182
            return cpu_x86_gdb_load_seg(env, R_CS, mem_buf);
191
            return x86_cpu_gdb_load_seg(cpu, R_CS, mem_buf);
183 192
        case IDX_SEG_REGS + 1:
184
            return cpu_x86_gdb_load_seg(env, R_SS, mem_buf);
193
            return x86_cpu_gdb_load_seg(cpu, R_SS, mem_buf);
185 194
        case IDX_SEG_REGS + 2:
186
            return cpu_x86_gdb_load_seg(env, R_DS, mem_buf);
195
            return x86_cpu_gdb_load_seg(cpu, R_DS, mem_buf);
187 196
        case IDX_SEG_REGS + 3:
188
            return cpu_x86_gdb_load_seg(env, R_ES, mem_buf);
197
            return x86_cpu_gdb_load_seg(cpu, R_ES, mem_buf);
189 198
        case IDX_SEG_REGS + 4:
190
            return cpu_x86_gdb_load_seg(env, R_FS, mem_buf);
199
            return x86_cpu_gdb_load_seg(cpu, R_FS, mem_buf);
191 200
        case IDX_SEG_REGS + 5:
192
            return cpu_x86_gdb_load_seg(env, R_GS, mem_buf);
201
            return x86_cpu_gdb_load_seg(cpu, R_GS, mem_buf);
193 202

  
194 203
        case IDX_FP_REGS + 8:
195 204
            env->fpuc = ldl_p(mem_buf);
b/target-lm32/Makefile.objs
1 1
obj-y += translate.o op_helper.o helper.o cpu.o
2
obj-y += gdbstub.o
2 3
obj-$(CONFIG_SOFTMMU) += machine.o
b/target-lm32/cpu-qom.h
79 79
void lm32_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
80 80
                         int flags);
81 81
hwaddr lm32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
82
int lm32_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
83
int lm32_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
82 84

  
83 85
#endif
b/target-lm32/cpu.c
87 87
    cc->do_interrupt = lm32_cpu_do_interrupt;
88 88
    cc->dump_state = lm32_cpu_dump_state;
89 89
    cc->set_pc = lm32_cpu_set_pc;
90
    cc->gdb_read_register = lm32_cpu_gdb_read_register;
91
    cc->gdb_write_register = lm32_cpu_gdb_write_register;
90 92
#ifndef CONFIG_USER_ONLY
91 93
    cc->get_phys_page_debug = lm32_cpu_get_phys_page_debug;
92 94
    cc->vmsd = &vmstate_lm32_cpu;
b/target-lm32/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23
#include "hw/lm32/lm32_pic.h"
21 24

  
22
static int cpu_gdb_read_register(CPULM32State *env, uint8_t *mem_buf, int n)
25
int lm32_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
23 26
{
27
    LM32CPU *cpu = LM32_CPU(cs);
28
    CPULM32State *env = &cpu->env;
29

  
24 30
    if (n < 32) {
25 31
        return gdb_get_reg32(mem_buf, env->regs[n]);
26 32
    } else {
......
45 51
    return 0;
46 52
}
47 53

  
48
static int cpu_gdb_write_register(CPULM32State *env, uint8_t *mem_buf, int n)
54
int lm32_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
49 55
{
50
    LM32CPU *cpu = lm32_env_get_cpu(env);
51
    CPUClass *cc = CPU_GET_CLASS(cpu);
56
    LM32CPU *cpu = LM32_CPU(cs);
57
    CPUClass *cc = CPU_GET_CLASS(cs);
58
    CPULM32State *env = &cpu->env;
52 59
    uint32_t tmp;
53 60

  
54 61
    if (n > cc->gdb_num_core_regs) {
b/target-m68k/Makefile.objs
1 1
obj-y += m68k-semi.o
2 2
obj-y += translate.o op_helper.o helper.o cpu.o
3
obj-y += gdbstub.o
b/target-m68k/cpu-qom.h
74 74
void m68k_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
75 75
                         int flags);
76 76
hwaddr m68k_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
77
int m68k_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
78
int m68k_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
77 79

  
78 80
#endif
b/target-m68k/cpu.c
190 190
    cc->do_interrupt = m68k_cpu_do_interrupt;
191 191
    cc->dump_state = m68k_cpu_dump_state;
192 192
    cc->set_pc = m68k_cpu_set_pc;
193
    cc->gdb_read_register = m68k_cpu_gdb_read_register;
194
    cc->gdb_write_register = m68k_cpu_gdb_write_register;
193 195
#ifndef CONFIG_USER_ONLY
194 196
    cc->get_phys_page_debug = m68k_cpu_get_phys_page_debug;
195 197
#endif
b/target-m68k/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUM68KState *env, uint8_t *mem_buf, int n)
24
int m68k_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    M68kCPU *cpu = M68K_CPU(cs);
27
    CPUM68KState *env = &cpu->env;
28

  
23 29
    if (n < 8) {
24 30
        /* D0-D7 */
25 31
        return gdb_get_reg32(mem_buf, env->dregs[n]);
......
39 45
    return 0;
40 46
}
41 47

  
42
static int cpu_gdb_write_register(CPUM68KState *env, uint8_t *mem_buf, int n)
48
int m68k_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
43 49
{
50
    M68kCPU *cpu = M68K_CPU(cs);
51
    CPUM68KState *env = &cpu->env;
44 52
    uint32_t tmp;
45 53

  
46 54
    tmp = ldl_p(mem_buf);
b/target-microblaze/Makefile.objs
1 1
obj-y += translate.o op_helper.o helper.o cpu.o
2
obj-y += gdbstub.o
2 3
obj-$(CONFIG_SOFTMMU) += mmu.o
b/target-microblaze/cpu-qom.h
75 75
void mb_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
76 76
                       int flags);
77 77
hwaddr mb_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
78
int mb_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
79
int mb_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
78 80

  
79 81
#endif
b/target-microblaze/cpu.c
141 141
    cc->do_interrupt = mb_cpu_do_interrupt;
142 142
    cc->dump_state = mb_cpu_dump_state;
143 143
    cc->set_pc = mb_cpu_set_pc;
144
    cc->gdb_read_register = mb_cpu_gdb_read_register;
145
    cc->gdb_write_register = mb_cpu_gdb_write_register;
144 146
#ifndef CONFIG_USER_ONLY
145 147
    cc->do_unassigned_access = mb_cpu_unassigned_access;
146 148
    cc->get_phys_page_debug = mb_cpu_get_phys_page_debug;
b/target-microblaze/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUMBState *env, uint8_t *mem_buf, int n)
24
int mb_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
27
    CPUMBState *env = &cpu->env;
28

  
23 29
    if (n < 32) {
24 30
        return gdb_get_reg32(mem_buf, env->regs[n]);
25 31
    } else {
......
28 34
    return 0;
29 35
}
30 36

  
31
static int cpu_gdb_write_register(CPUMBState *env, uint8_t *mem_buf, int n)
37
int mb_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
32 38
{
33
    MicroBlazeCPU *cpu = mb_env_get_cpu(env);
34
    CPUClass *cc = CPU_GET_CLASS(cpu);
39
    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
40
    CPUClass *cc = CPU_GET_CLASS(cs);
41
    CPUMBState *env = &cpu->env;
35 42
    uint32_t tmp;
36 43

  
37 44
    if (n > cc->gdb_num_core_regs) {
b/target-mips/Makefile.objs
1 1
obj-y += translate.o dsp_helper.o op_helper.o lmi_helper.o helper.o cpu.o
2
obj-y += gdbstub.o
2 3
obj-$(CONFIG_SOFTMMU) += machine.o
b/target-mips/cpu-qom.h
78 78
void mips_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
79 79
                         int flags);
80 80
hwaddr mips_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
81
int mips_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
82
int mips_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
81 83

  
82 84
#endif
b/target-mips/cpu.c
100 100
    cc->dump_state = mips_cpu_dump_state;
101 101
    cc->set_pc = mips_cpu_set_pc;
102 102
    cc->synchronize_from_tb = mips_cpu_synchronize_from_tb;
103
    cc->gdb_read_register = mips_cpu_gdb_read_register;
104
    cc->gdb_write_register = mips_cpu_gdb_write_register;
103 105
#ifndef CONFIG_USER_ONLY
104 106
    cc->do_unassigned_access = mips_cpu_unassigned_access;
105 107
    cc->get_phys_page_debug = mips_cpu_get_phys_page_debug;
b/target-mips/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUMIPSState *env, uint8_t *mem_buf, int n)
24
int mips_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    MIPSCPU *cpu = MIPS_CPU(cs);
27
    CPUMIPSState *env = &cpu->env;
28

  
23 29
    if (n < 32) {
24 30
        return gdb_get_regl(mem_buf, env->active_tc.gpr[n]);
25 31
    }
......
78 84
    set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], \
79 85
                            &env->active_fpu.fp_status)
80 86

  
81
static int cpu_gdb_write_register(CPUMIPSState *env, uint8_t *mem_buf, int n)
87
int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
82 88
{
89
    MIPSCPU *cpu = MIPS_CPU(cs);
90
    CPUMIPSState *env = &cpu->env;
83 91
    target_ulong tmp;
84 92

  
85 93
    tmp = ldtul_p(mem_buf);
b/target-openrisc/Makefile.objs
2 2
obj-y += cpu.o exception.o interrupt.o mmu.o translate.o
3 3
obj-y += exception_helper.o fpu_helper.o int_helper.o \
4 4
         interrupt_helper.o mmu_helper.o sys_helper.o
5
obj-y += gdbstub.o
b/target-openrisc/cpu.c
155 155
    cc->do_interrupt = openrisc_cpu_do_interrupt;
156 156
    cc->dump_state = openrisc_cpu_dump_state;
157 157
    cc->set_pc = openrisc_cpu_set_pc;
158
    cc->gdb_read_register = openrisc_cpu_gdb_read_register;
159
    cc->gdb_write_register = openrisc_cpu_gdb_write_register;
158 160
#ifndef CONFIG_USER_ONLY
159 161
    cc->get_phys_page_debug = openrisc_cpu_get_phys_page_debug;
160 162
    dc->vmsd = &vmstate_openrisc_cpu;
b/target-openrisc/cpu.h
350 350
void openrisc_cpu_dump_state(CPUState *cpu, FILE *f,
351 351
                             fprintf_function cpu_fprintf, int flags);
352 352
hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
353
int openrisc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
354
int openrisc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
353 355
void openrisc_translate_init(void);
354 356
int cpu_openrisc_handle_mmu_fault(CPUOpenRISCState *env,
355 357
                                  target_ulong address,
b/target-openrisc/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUOpenRISCState *env, uint8_t *mem_buf, int n)
24
int openrisc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    OpenRISCCPU *cpu = OPENRISC_CPU(cs);
27
    CPUOpenRISCState *env = &cpu->env;
28

  
23 29
    if (n < 32) {
24 30
        return gdb_get_reg32(mem_buf, env->gpr[n]);
25 31
    } else {
......
40 46
    return 0;
41 47
}
42 48

  
43
static int cpu_gdb_write_register(CPUOpenRISCState *env,
44
                                  uint8_t *mem_buf, int n)
49
int openrisc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
45 50
{
46
    OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
47
    CPUClass *cc = CPU_GET_CLASS(cpu);
51
    OpenRISCCPU *cpu = OPENRISC_CPU(cs);
52
    CPUClass *cc = CPU_GET_CLASS(cs);
53
    CPUOpenRISCState *env = &cpu->env;
48 54
    uint32_t tmp;
49 55

  
50 56
    if (n > cc->gdb_num_core_regs) {
b/target-ppc/Makefile.objs
13 13
obj-y += misc_helper.o
14 14
obj-y += mem_helper.o
15 15
obj-$(CONFIG_USER_ONLY) += user_only_helper.o
16
obj-y += gdbstub.o
b/target-ppc/cpu-qom.h
106 106
void ppc_cpu_dump_statistics(CPUState *cpu, FILE *f,
107 107
                             fprintf_function cpu_fprintf, int flags);
108 108
hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
109
int ppc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
110
int ppc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
109 111

  
110 112
#endif
b/target-ppc/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
/* Old gdb always expects FP registers.  Newer (xml-aware) gdb only
22 25
 * expects whatever the target description contains.  Due to a
......
25 28
 * FP regs zero size when talking to a newer gdb.
26 29
 */
27 30

  
28
static int cpu_gdb_read_register(CPUPPCState *env, uint8_t *mem_buf, int n)
31
int ppc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
29 32
{
33
    PowerPCCPU *cpu = POWERPC_CPU(cs);
34
    CPUPPCState *env = &cpu->env;
35

  
30 36
    if (n < 32) {
31 37
        /* gprs */
32 38
        return gdb_get_regl(mem_buf, env->gpr[n]);
......
70 76
    return 0;
71 77
}
72 78

  
73
static int cpu_gdb_write_register(CPUPPCState *env, uint8_t *mem_buf, int n)
79
int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
74 80
{
81
    PowerPCCPU *cpu = POWERPC_CPU(cs);
82
    CPUPPCState *env = &cpu->env;
83

  
75 84
    if (n < 32) {
76 85
        /* gprs */
77 86
        env->gpr[n] = ldtul_p(mem_buf);
b/target-ppc/translate_init.c
8458 8458
    cc->dump_state = ppc_cpu_dump_state;
8459 8459
    cc->dump_statistics = ppc_cpu_dump_statistics;
8460 8460
    cc->set_pc = ppc_cpu_set_pc;
8461
    cc->gdb_read_register = ppc_cpu_gdb_read_register;
8462
    cc->gdb_write_register = ppc_cpu_gdb_write_register;
8461 8463
#ifndef CONFIG_USER_ONLY
8462 8464
    cc->get_phys_page_debug = ppc_cpu_get_phys_page_debug;
8463 8465
#endif
b/target-s390x/Makefile.objs
1 1
obj-y += translate.o helper.o cpu.o interrupt.o
2 2
obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
3
obj-y += gdbstub.o
3 4
obj-$(CONFIG_SOFTMMU) += ioinst.o
4 5
obj-$(CONFIG_KVM) += kvm.o
b/target-s390x/cpu-qom.h
75 75
void s390_cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
76 76
                         int flags);
77 77
hwaddr s390_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
78
int s390_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
79
int s390_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
78 80

  
79 81
#endif
b/target-s390x/cpu.c
173 173
    cc->do_interrupt = s390_cpu_do_interrupt;
174 174
    cc->dump_state = s390_cpu_dump_state;
175 175
    cc->set_pc = s390_cpu_set_pc;
176
    cc->gdb_read_register = s390_cpu_gdb_read_register;
177
    cc->gdb_write_register = s390_cpu_gdb_write_register;
176 178
#ifndef CONFIG_USER_ONLY
177 179
    cc->get_phys_page_debug = s390_cpu_get_phys_page_debug;
178 180
#endif
b/target-s390x/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
23
#include "qemu/bitops.h"
20 24

  
21
static int cpu_gdb_read_register(CPUS390XState *env, uint8_t *mem_buf, int n)
25
int s390_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 26
{
27
    S390CPU *cpu = S390_CPU(cs);
28
    CPUS390XState *env = &cpu->env;
23 29
    uint64_t val;
24 30
    int cc_op;
25 31

  
......
43 49
    return 0;
44 50
}
45 51

  
46
static int cpu_gdb_write_register(CPUS390XState *env, uint8_t *mem_buf, int n)
52
int s390_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
47 53
{
54
    S390CPU *cpu = S390_CPU(cs);
55
    CPUS390XState *env = &cpu->env;
48 56
    target_ulong tmpl;
49 57
    uint32_t tmp32;
50 58
    int r = 8;
b/target-sh4/Makefile.objs
1 1
obj-y += translate.o op_helper.o helper.o cpu.o
2
obj-y += gdbstub.o
b/target-sh4/cpu-qom.h
87 87
void superh_cpu_dump_state(CPUState *cpu, FILE *f,
88 88
                           fprintf_function cpu_fprintf, int flags);
89 89
hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
90
int superh_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
91
int superh_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
90 92

  
91 93
#endif
b/target-sh4/cpu.c
286 286
    cc->dump_state = superh_cpu_dump_state;
287 287
    cc->set_pc = superh_cpu_set_pc;
288 288
    cc->synchronize_from_tb = superh_cpu_synchronize_from_tb;
289
    cc->gdb_read_register = superh_cpu_gdb_read_register;
290
    cc->gdb_write_register = superh_cpu_gdb_write_register;
289 291
#ifndef CONFIG_USER_ONLY
290 292
    cc->get_phys_page_debug = superh_cpu_get_phys_page_debug;
291 293
#endif
b/target-sh4/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
/* Hint: Use "set architecture sh4" in GDB to see fpu registers */
22 25
/* FIXME: We should use XML for this.  */
23 26

  
24
static int cpu_gdb_read_register(CPUSH4State *env, uint8_t *mem_buf, int n)
27
int superh_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
25 28
{
29
    SuperHCPU *cpu = SUPERH_CPU(cs);
30
    CPUSH4State *env = &cpu->env;
31

  
26 32
    switch (n) {
27 33
    case 0 ... 7:
28 34
        if ((env->sr & (SR_MD | SR_RB)) == (SR_MD | SR_RB)) {
......
70 76
    return 0;
71 77
}
72 78

  
73
static int cpu_gdb_write_register(CPUSH4State *env, uint8_t *mem_buf, int n)
79
int superh_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
74 80
{
81
    SuperHCPU *cpu = SUPERH_CPU(cs);
82
    CPUSH4State *env = &cpu->env;
83

  
75 84
    switch (n) {
76 85
    case 0 ... 7:
77 86
        if ((env->sr & (SR_MD | SR_RB)) == (SR_MD | SR_RB)) {
b/target-sparc/Makefile.objs
4 4
obj-$(TARGET_SPARC) += int32_helper.o
5 5
obj-$(TARGET_SPARC64) += int64_helper.o
6 6
obj-$(TARGET_SPARC64) += vis_helper.o
7
obj-y += gdbstub.o
b/target-sparc/cpu-qom.h
79 79
void sparc_cpu_dump_state(CPUState *cpu, FILE *f,
80 80
                          fprintf_function cpu_fprintf, int flags);
81 81
hwaddr sparc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
82
int sparc_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
83
int sparc_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
82 84

  
83 85
#endif
b/target-sparc/cpu.c
787 787
#endif
788 788
    cc->set_pc = sparc_cpu_set_pc;
789 789
    cc->synchronize_from_tb = sparc_cpu_synchronize_from_tb;
790
    cc->gdb_read_register = sparc_cpu_gdb_read_register;
791
    cc->gdb_write_register = sparc_cpu_gdb_write_register;
790 792
#ifndef CONFIG_USER_ONLY
791 793
    cc->do_unassigned_access = sparc_cpu_unassigned_access;
792 794
    cc->get_phys_page_debug = sparc_cpu_get_phys_page_debug;
b/target-sparc/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21 24
#ifdef TARGET_ABI32
22 25
#define gdb_get_rega(buf, val) gdb_get_reg32(buf, val)
......
24 27
#define gdb_get_rega(buf, val) gdb_get_regl(buf, val)
25 28
#endif
26 29

  
27
static int cpu_gdb_read_register(CPUSPARCState *env, uint8_t *mem_buf, int n)
30
int sparc_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
28 31
{
32
    SPARCCPU *cpu = SPARC_CPU(cs);
33
    CPUSPARCState *env = &cpu->env;
34

  
29 35
    if (n < 8) {
30 36
        /* g0..g7 */
31 37
        return gdb_get_rega(mem_buf, env->gregs[n]);
......
98 104
    return 0;
99 105
}
100 106

  
101
static int cpu_gdb_write_register(CPUSPARCState *env, uint8_t *mem_buf, int n)
107
int sparc_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
102 108
{
109
    SPARCCPU *cpu = SPARC_CPU(cs);
110
    CPUSPARCState *env = &cpu->env;
103 111
#if defined(TARGET_ABI32)
104 112
    abi_ulong tmp;
105 113

  
b/target-xtensa/Makefile.objs
3 3
obj-y += core-dc233c.o
4 4
obj-y += core-fsf.o
5 5
obj-y += translate.o op_helper.o helper.o cpu.o
6
obj-y += gdbstub.o
b/target-xtensa/cpu-qom.h
87 87
void xtensa_cpu_dump_state(CPUState *cpu, FILE *f,
88 88
                           fprintf_function cpu_fprintf, int flags);
89 89
hwaddr xtensa_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
90
int xtensa_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
91
int xtensa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
90 92

  
91 93
#endif
b/target-xtensa/cpu.c
133 133
    cc->do_interrupt = xtensa_cpu_do_interrupt;
134 134
    cc->dump_state = xtensa_cpu_dump_state;
135 135
    cc->set_pc = xtensa_cpu_set_pc;
136
    cc->gdb_read_register = xtensa_cpu_gdb_read_register;
137
    cc->gdb_write_register = xtensa_cpu_gdb_write_register;
136 138
#ifndef CONFIG_USER_ONLY
137 139
    cc->get_phys_page_debug = xtensa_cpu_get_phys_page_debug;
138 140
#endif
b/target-xtensa/gdbstub.c
17 17
 * You should have received a copy of the GNU Lesser General Public
18 18
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 19
 */
20
#include "config.h"
21
#include "qemu-common.h"
22
#include "exec/gdbstub.h"
20 23

  
21
static int cpu_gdb_read_register(CPUXtensaState *env, uint8_t *mem_buf, int n)
24
int xtensa_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
22 25
{
26
    XtensaCPU *cpu = XTENSA_CPU(cs);
27
    CPUXtensaState *env = &cpu->env;
23 28
    const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
24 29

  
25 30
    if (n < 0 || n >= env->config->gdb_regmap.num_regs) {
......
55 60
    }
56 61
}
57 62

  
58
static int cpu_gdb_write_register(CPUXtensaState *env, uint8_t *mem_buf, int n)
63
int xtensa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
59 64
{
65
    XtensaCPU *cpu = XTENSA_CPU(cs);
66
    CPUXtensaState *env = &cpu->env;
60 67
    uint32_t tmp;
61 68
    const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
62 69

  

Also available in: Unified diff