diff --git a/libr/debug/p/native/linux/linux_debug.c b/libr/debug/p/native/linux/linux_debug.c index d963250de2..27dc7aefe4 100644 --- a/libr/debug/p/native/linux/linux_debug.c +++ b/libr/debug/p/native/linux/linux_debug.c @@ -24,6 +24,8 @@ const char *linux_reg_profile (RDebug *dbg) { } else { #include "reg/linux-x64.h" } +#elif __ppc__ || __powerpc__ || __POWERPC__ +#include "reg/linux-ppc.h" #else #error "Unsupported Linux CPU" #endif diff --git a/libr/debug/p/native/linux/reg/linux-ppc.h b/libr/debug/p/native/linux/reg/linux-ppc.h new file mode 100644 index 0000000000..808c3d5cfc --- /dev/null +++ b/libr/debug/p/native/linux/reg/linux-ppc.h @@ -0,0 +1,57 @@ +return strdup ( +"=PC srr0\n" +"=SP srr1\n" +"=SR srr1\n" // status register ?? +"=A0 r0\n" +"=A1 r1\n" +"=A2 r2\n" +"=A3 r3\n" +#if 0 +"=A4 r4\n" +"=A5 r5\n" +"=A6 r6\n" +"=A7 r7\n" +#endif +"gpr srr0 .32 0 0\n" +"gpr srr1 .32 4 0\n" +"gpr r0 .32 8 0\n" +"gpr r1 .32 12 0\n" +"gpr r2 .32 16 0\n" +"gpr r3 .32 20 0\n" +"gpr r4 .32 24 0\n" +"gpr r5 .32 28 0\n" +"gpr r6 .32 32 0\n" +"gpr r7 .32 36 0\n" +"gpr r8 .32 40 0\n" +"gpr r9 .32 44 0\n" +"gpr r10 .32 48 0\n" +"gpr r11 .32 52 0\n" +"gpr r12 .32 56 0\n" +"gpr r13 .32 60 0\n" +"gpr r14 .32 64 0\n" +"gpr r15 .32 68 0\n" +"gpr r16 .32 72 0\n" +"gpr r17 .32 76 0\n" +"gpr r18 .32 80 0\n" +"gpr r19 .32 84 0\n" +"gpr r20 .32 88 0\n" +"gpr r21 .32 92 0\n" +"gpr r22 .32 96 0\n" + +"gpr r23 .32 100 0\n" +"gpr r24 .32 104 0\n" +"gpr r25 .32 108 0\n" +"gpr r26 .32 112 0\n" +"gpr r27 .32 116 0\n" +"gpr r28 .32 120 0\n" +"gpr r29 .32 124 0\n" +"gpr r30 .32 128 0\n" +"gpr r31 .32 132 0\n" +"gpr cr .32 136 0\n" +"gpr xer .32 140 0\n" +"gpr lr .32 144 0\n" +"gpr ctr .32 148 0\n" +"gpr mq .32 152 0\n" +"gpr vrsave .32 156 0\n" +); + diff --git a/libr/debug/p/native/xnu/xnu_debug.c b/libr/debug/p/native/xnu/xnu_debug.c index e924ae2673..95071013bf 100644 --- a/libr/debug/p/native/xnu/xnu_debug.c +++ b/libr/debug/p/native/xnu/xnu_debug.c @@ -531,7 +531,7 @@ static void get_mach_header_sizes(size_t *mach_header_sz, #if __ppc64__ || __x86_64__ *mach_header_sz = sizeof(struct mach_header_64); *segment_command_sz = sizeof(struct segment_command_64); -#elif __i386__ || __ppc__ +#elif __i386__ || __ppc__ || __POWERPC__ *mach_header_sz = sizeof(struct mach_header); *segment_command_sz = sizeof(struct segment_command); #else @@ -582,7 +582,7 @@ static void xnu_build_corefile_header (vm_offset_t header, mh64->ncmds = segment_count + thread_count; mh64->sizeofcmds = command_size; mh64->reserved = 0; // 8-byte alignment -#elif __i386__ || __ppc__ +#elif __i386__ || __ppc__ || __POWERPC__ struct mach_header *mh; mh = (struct mach_header *)header; mh->magic = MH_MAGIC; @@ -632,7 +632,7 @@ static int xnu_write_mem_maps_to_buffer (RBuffer *buffer, RList *mem_maps, int s #define CAST_DOWN(type, addr) (((type)((uintptr_t)(addr)))) #if __ppc64__ || __x86_64__ struct segment_command_64 *sc64; -#elif __i386__ || __ppc__ +#elif __i386__ || __ppc__ || __POWERPC__ struct segment_command *sc; #endif