diff options
author | gdb-2.8.1 <gdb@fsf.org> | 1988-12-16 00:00:00 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-06-03 15:36:31 +0100 |
commit | bb7592f01006b09c846831a9fb9c306307ba34f6 (patch) | |
tree | 83e99233f937d7a06eee7c627543288feb125929 /gdb/inflow.c | |
parent | 3bf57d210832b28e9361990830eb722a619f031b (diff) | |
download | gdb-bb7592f01006b09c846831a9fb9c306307ba34f6.zip gdb-bb7592f01006b09c846831a9fb9c306307ba34f6.tar.gz gdb-bb7592f01006b09c846831a9fb9c306307ba34f6.tar.bz2 |
gdb-2.8.1
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r-- | gdb/inflow.c | 92 |
1 files changed, 82 insertions, 10 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c index 386a2e1..11e5e92 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -461,7 +461,15 @@ resume (step, signal) remote_resume (step, signal); else { +#ifdef NO_SINGLE_STEP + if (step) + { + single_step (signal); + } + else ptrace (7, inferior_pid, 1, signal); +#else ptrace (step ? 9 : 7, inferior_pid, 1, signal); +#endif if (errno) perror_with_name ("ptrace"); } @@ -514,6 +522,7 @@ fetch_inferior_registers () ptrace (PTRACE_GETREGS, inferior_pid, &inferior_registers); ptrace (PTRACE_GETFPREGS, inferior_pid, &inferior_fp_registers); +#if defined(sun2) || defined(sun3) bcopy (&inferior_registers, registers, 16 * 4); bcopy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], sizeof inferior_fp_registers.fps_regs); @@ -522,6 +531,25 @@ fetch_inferior_registers () bcopy (&inferior_fp_registers.fps_control, ®isters[REGISTER_BYTE (FPC_REGNUM)], sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); +#endif +#if defined(sun4) + registers[REGISTER_BYTE (0)] = 0; + bcopy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (1)], 15 * 4); + bcopy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)], + sizeof inferior_fp_registers.fpu_fr); + *(int *)®isters[REGISTER_BYTE (PS_REGNUM)] = inferior_registers.r_ps; + *(int *)®isters[REGISTER_BYTE (PC_REGNUM)] = inferior_registers.r_pc; + *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)] = inferior_registers.r_npc; + *(int *)®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y; +/* *(int *)®isters[REGISTER_BYTE (RP_REGNUM)] = + inferior_registers.r_o7 + 8; + bcopy (&inferior_fp_registers.Fpu_fsr, + ®isters[REGISTER_BYTE (FPS_REGNUM)], + sizeof (FPU_FSR_TYPE)); */ + read_inferior_memory (inferior_registers.r_sp, + ®isters[REGISTER_BYTE (16)], + 16*4); +#endif } } @@ -540,17 +568,61 @@ store_inferior_registers (regno) remote_store_registers (registers); else { - bcopy (registers, &inferior_registers, 16 * 4); - bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, - sizeof inferior_fp_registers.fps_regs); - inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; - inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; - bcopy (®isters[REGISTER_BYTE (FPC_REGNUM)], - &inferior_fp_registers.fps_control, - sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); + int in_regs = 1, in_fpregs = 1, in_fparegs, in_cpregs = 1; - ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers); - ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers); +#if defined(sun2) || defined(sun3) + if (in_regs) + { + bcopy (registers, &inferior_registers, 16 * 4); + inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + } + if (in_fpregs) + { + bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, + sizeof inferior_fp_registers.fps_regs); + bcopy (®isters[REGISTER_BYTE (FPC_REGNUM)], + &inferior_fp_registers.fps_control, + sizeof inferior_fp_registers - sizeof inferior_fp_registers.fps_regs); + } + if (in_regs) + ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers); + if (in_fpregs) + ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers); +#endif +#if defined(sun4) + if (regno >= 0) + if (FP0_REGNUM <= regno && regno <= FP0_REGNUM + 32) + in_regs = 0; + else + in_fpregs = 0; + + if (in_regs) + { + bcopy (®isters[REGISTER_BYTE (1)], &inferior_registers.r_g1, 15 * 4); + inferior_registers.r_ps = *(int *)®isters[REGISTER_BYTE (PS_REGNUM)]; + inferior_registers.r_pc = *(int *)®isters[REGISTER_BYTE (PC_REGNUM)]; + inferior_registers.r_npc = *(int *)®isters[REGISTER_BYTE (NPC_REGNUM)]; + inferior_registers.r_y = *(int *)®isters[REGISTER_BYTE (Y_REGNUM)]; + write_inferior_memory (*(int *)®isters[REGISTER_BYTE (SP_REGNUM)], + ®isters[REGISTER_BYTE (16)], + 16*4); + } + if (in_fpregs) + { + bcopy (®isters[REGISTER_BYTE (FP0_REGNUM)], &inferior_fp_registers, + sizeof inferior_fp_registers.fpu_fr); + /* bcopy (®isters[REGISTER_BYTE (FPS_REGNUM)], + &inferior_fp_registers.Fpu_fsr, + sizeof (FPU_FSR_TYPE)); + ****/ + } + + if (in_regs) + ptrace (PTRACE_SETREGS, inferior_pid, &inferior_registers); + if (in_fpregs) + ptrace (PTRACE_SETFPREGS, inferior_pid, &inferior_fp_registers); +#endif } } |