fetch_regs (struct regcache *regcache, int tid)
{
elf_gregset_t regs;
+ elf_gregset_t *regs_p = ®s;
if (ptrace (PTRACE_GETREGS, tid, 0, (int) ®s) < 0)
{
perror_with_name (_("Couldn't get registers"));
}
- supply_gregset (regcache, (const elf_gregset_t *) ®s);
+ supply_gregset (regcache, (const elf_gregset_t *) regs_p);
}
/* Store all valid general-purpose registers in GDB's register array
if (step)
{
- struct cleanup *old_chain = save_inferior_ptid ();
- struct regcache *regcache = current_regcache;
+ struct regcache *regcache = get_thread_regcache (pid_to_ptid (pid));
ULONGEST pc;
gdb_byte buf[LINUX_SYSCALL_LEN];
request = PTRACE_SINGLESTEP;
- inferior_ptid = pid_to_ptid (pid);
- regcache_cooked_read_unsigned (regcache, PC_REGNUM, &pc);
+ regcache_cooked_read_unsigned (regcache,
+ gdbarch_pc_regnum (current_gdbarch), &pc);
/* Returning from a signal trampoline is done by calling a
special system call (sigreturn or rt_sigreturn, see
write_memory (addr, (gdb_byte *) &eflags, 4);
}
}
-
- do_cleanups (old_chain);
}
if (ptrace (request, pid, 0, target_signal_to_host (signal)) == -1)