No more linux-ppc blindfixing. This one is for real

This commit is contained in:
pancake 2016-05-19 16:21:57 +02:00
parent cc39d55be2
commit 48d5e668eb
2 changed files with 25 additions and 3 deletions

View File

@ -24,7 +24,7 @@ const char *linux_reg_profile (RDebug *dbg) {
} else {
#include "reg/linux-x64.h"
}
#elif __ppc__ || __powerpc__ || __POWERPC__
#elif __ppc__ || __powerpc || __powerpc__ || __POWERPC__
#include "reg/linux-ppc.h"
#else
#error "Unsupported Linux CPU"
@ -451,7 +451,7 @@ int linux_reg_write (RDebug *dbg, int type, const ut8 *buf, int size) {
};
int ret = ptrace (PTRACE_SETREGSET, dbg->pid, NT_PRSTATUS, &io);
#elif __POWERPC__
int ret = ptrace (PTRACE_SETREGS, dbg->pid, &regs, NULL);
int ret = ptrace (PTRACE_SETREGS, dbg->pid, buf, NULL);
#else
int ret = ptrace (PTRACE_SETREGS, dbg->pid, 0, (void*)buf);
#endif

View File

@ -45,7 +45,29 @@ struct user_regs_struct_x86_32 {
#elif __arm__
#define R_DEBUG_REG_T struct user_regs
#elif __POWERPC__
#define R_DEBUG_REG_T struct pt_regs_t
struct powerpc_regs_t {
unsigned long gpr[32];
unsigned long nip;
unsigned long msr;
unsigned long orig_gpr3; /* Used for restarting system calls */
unsigned long ctr;
unsigned long link;
unsigned long xer;
unsigned long ccr;
#ifdef __powerpc64__
unsigned long softe; /* Soft enabled/disabled */
#else
unsigned long mq; /* 601 only (not used at present) */
/* Used on APUS to hold IPL value. */
#endif
unsigned long trap; /* Reason for being here */
/* N.B. for critical exceptions on 4xx, the dar and dsisr
fields are overloaded to hold srr0 and srr1. */
unsigned long dar; /* Fault registers */
unsigned long dsisr; /* on 4xx/Book-E used for ESR */
unsigned long result; /* Result of a system call */
};
#define R_DEBUG_REG_T struct powerpc_regs_t
#elif __mips__
#include <sys/ucontext.h>