[Bug gdb/25162] [GDB, kgdb] gdb 8.3.1 truncated register in remote g packet

luis.machado at linaro dot org sourceware-bugzilla@sourceware.org
Tue Nov 5 20:20:00 GMT 2019


https://sourceware.org/bugzilla/show_bug.cgi?id=25162

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #1 from Luis Machado <luis.machado at linaro dot org> ---
Looking at kgdb's code (HEAD kernel) for arm (arch/arm/kernel/kgdb.c), i see
the correct register set that works with GDB. And that hasn't been changed
since at least 2010.

struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] =
{
        { "r0", 4, offsetof(struct pt_regs, ARM_r0)},
        { "r1", 4, offsetof(struct pt_regs, ARM_r1)},
        { "r2", 4, offsetof(struct pt_regs, ARM_r2)},
        { "r3", 4, offsetof(struct pt_regs, ARM_r3)},
        { "r4", 4, offsetof(struct pt_regs, ARM_r4)},
        { "r5", 4, offsetof(struct pt_regs, ARM_r5)},
        { "r6", 4, offsetof(struct pt_regs, ARM_r6)},
        { "r7", 4, offsetof(struct pt_regs, ARM_r7)},
        { "r8", 4, offsetof(struct pt_regs, ARM_r8)},
        { "r9", 4, offsetof(struct pt_regs, ARM_r9)},
        { "r10", 4, offsetof(struct pt_regs, ARM_r10)},
        { "fp", 4, offsetof(struct pt_regs, ARM_fp)},
        { "ip", 4, offsetof(struct pt_regs, ARM_ip)},
        { "sp", 4, offsetof(struct pt_regs, ARM_sp)},
        { "lr", 4, offsetof(struct pt_regs, ARM_lr)},
        { "pc", 4, offsetof(struct pt_regs, ARM_pc)},
        { "f0", 12, -1 },
        { "f1", 12, -1 },
        { "f2", 12, -1 },
        { "f3", 12, -1 },
        { "f4", 12, -1 },
        { "f5", 12, -1 },
        { "f6", 12, -1 },
        { "f7", 12, -1 },
        { "fps", 4, -1 },
        { "cpsr", 4, offsetof(struct pt_regs, ARM_cpsr)},
};

This is precisely the register set GDB wants to see reported in the g packet.

The g packets above don't seem to contain all of the registers. In fact,
register f2 (register 19) is truncated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list