if ((fail = procfs_debug_inferior (pi)) != 0)
dead_procinfo (pi, "do_attach: failed in procfs_debug_inferior", NOKILL);
- inf = add_inferior (pi->pid);
+ inf = current_inferior ();
+ inferior_appeared (inf, pi->pid);
/* Let GDB know that the inferior was attached. */
inf->attach_flag = 1;
{
/* Insert the breakpoint. */
dbx_link_bpt_addr = sym_addr;
- dbx_link_bpt = deprecated_insert_raw_breakpoint (target_gdbarch,
+ dbx_link_bpt = deprecated_insert_raw_breakpoint (target_gdbarch, NULL,
sym_addr);
if (dbx_link_bpt == NULL)
{
gdb_gregset_t gregs;
gdb_fpregset_t fpregs;
unsigned long merged_pid;
+ struct cleanup *old_chain;
merged_pid = TIDGET (ptid) << 16 | PIDGET (ptid);
+ /* This part is the old method for fetching registers.
+ It should be replaced by the newer one using regsets
+ once it is implemented in this platform:
+ gdbarch_regset_from_core_section() and regset->collect_regset(). */
+
+ old_chain = save_inferior_ptid ();
+ inferior_ptid = ptid;
+ target_fetch_registers (regcache, -1);
+
fill_gregset (regcache, &gregs, -1);
#if defined (UNIXWARE)
note_data = (char *) elfcore_write_lwpstatus (obfd,
note_size,
&fpregs,
sizeof (fpregs));
+
+ do_cleanups (old_chain);
+
return note_data;
}
if (pi != NULL)
{
- ptid_t saved_ptid = inferior_ptid;
- inferior_ptid = MERGEPID (pi->pid, thread->tid);
- args->note_data = procfs_do_thread_registers (args->obfd, inferior_ptid,
+ ptid_t ptid = MERGEPID (pi->pid, thread->tid);
+ args->note_data = procfs_do_thread_registers (args->obfd, ptid,
args->note_data,
args->note_size,
args->stop_signal);
- inferior_ptid = saved_ptid;
}
return 0;
}
stop_signal = find_stop_signal ();
-#ifdef NEW_PROC_API
+#ifdef UNIXWARE
fill_gregset (get_current_regcache (), &gregs, -1);
note_data = elfcore_write_pstatus (obfd, note_data, note_size,
PIDGET (inferior_ptid),