mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
target/ppc: Enable reporting of SPRs to GDB
This allows reading and writing of SPRs via GDB: (gdb) p/x $srr1 $1 = 0x8000000002803033 (gdb) p/x $pvr $2 = 0x4b0201 (gdb) set $pvr=0x4b0000 (gdb) p/x $pvr $3 = 0x4b0000 The `info` command can also be used: (gdb) info registers spr For this purpose, GDB needs to be provided with an XML description of the registers (see the gdb-xml directory for examples) and a set of callbacks for reading and writing the registers must be defined. The XML file in this case is created dynamically, based on the SPRs already defined in the machine. This way we avoid the need for several XML files to suit each possible ppc machine. The gdb_{get,set}_spr_reg callbacks take an index based on the order the registers appear in the XML file. This index does not match the actual location of the registers in the env->spr array so the gdb_find_spr_idx function does that conversion. Note: GDB currently needs to know the guest endianness in order to properly print the registers values. This is done automatically by GDB when provided with the ELF file or explicitly with the `set endian <big|little>` command. Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
5c7adcf422
commit
707c7c2ee1
4 changed files with 130 additions and 2 deletions
|
@ -179,6 +179,10 @@ typedef struct PowerPCCPUClass {
|
|||
uint32_t flags;
|
||||
int bfd_mach;
|
||||
uint32_t l1_dcache_size, l1_icache_size;
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
unsigned int gdb_num_sprs;
|
||||
const char *gdb_spr_xml;
|
||||
#endif
|
||||
const PPCHash64Options *hash64_opts;
|
||||
struct ppc_radix_page_info *radix_page_info;
|
||||
void (*init_proc)(CPUPPCState *env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue