Changeset View
Changeset View
Standalone View
Standalone View
gdb/files/kgdb/ppcfbsd-kern.c
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
ppcfbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr) | ppcfbsd_supply_pcb(struct regcache *regcache, CORE_ADDR pcb_addr) | ||||
{ | { | ||||
struct pcb pcb; | struct pcb pcb; | ||||
struct gdbarch_tdep *tdep; | struct gdbarch_tdep *tdep; | ||||
int i; | int i; | ||||
tdep = gdbarch_tdep (target_gdbarch()); | tdep = gdbarch_tdep (target_gdbarch()); | ||||
if (target_read_memory(pcb_addr, (gdb_byte *)&pcb, sizeof(pcb)) != 0) | if (target_read_memory(pcb_addr, &pcb, sizeof(pcb)) != 0) | ||||
memset(&pcb, 0, sizeof(pcb)); | memset(&pcb, 0, sizeof(pcb)); | ||||
/* | /* | ||||
* r14-r31 are saved in the pcb | * r14-r31 are saved in the pcb | ||||
*/ | */ | ||||
for (i = 14; i <= 31; i++) { | for (i = 14; i <= 31; i++) { | ||||
regcache_raw_supply(regcache, tdep->ppc_gp0_regnum + i, | regcache_raw_supply(regcache, tdep->ppc_gp0_regnum + i, | ||||
(char *)&pcb.pcb_context[i]); | (char *)&pcb.pcb_context[i]); | ||||
▲ Show 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
_initialize_ppc_kgdb_tdep(void) | _initialize_ppc_kgdb_tdep(void) | ||||
{ | { | ||||
gdbarch_register_osabi_sniffer(bfd_arch_powerpc, | gdbarch_register_osabi_sniffer(bfd_arch_powerpc, | ||||
bfd_target_elf_flavour, | bfd_target_elf_flavour, | ||||
fbsd_kernel_osabi_sniffer); | fbsd_kernel_osabi_sniffer); | ||||
gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, | gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, | ||||
GDB_OSABI_FREEBSD_ELF_KERNEL, ppcfbsd_kernel_init_abi); | GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi); | ||||
gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, | gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, | ||||
GDB_OSABI_FREEBSD_ELF_KERNEL, ppcfbsd_kernel_init_abi); | GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi); | ||||
/* Not sure about this one. */ | /* Not sure about this one. */ | ||||
gdbarch_register_osabi_sniffer(bfd_arch_rs6000, | gdbarch_register_osabi_sniffer(bfd_arch_rs6000, | ||||
bfd_target_elf_flavour, | bfd_target_elf_flavour, | ||||
fbsd_kernel_osabi_sniffer); | fbsd_kernel_osabi_sniffer); | ||||
gdbarch_register_osabi (bfd_arch_rs6000, 0, | gdbarch_register_osabi (bfd_arch_rs6000, 0, | ||||
GDB_OSABI_FREEBSD_ELF_KERNEL, ppcfbsd_kernel_init_abi); | GDB_OSABI_FREEBSD_KERNEL, ppcfbsd_kernel_init_abi); | ||||
} | } |