- pid = wait (&status);
- }
- while (pid != PIDGET (inferior_ptid));
-
- write_pc (prev_pc);
- deprecated_remove_raw_breakpoint (bp);
-}
-
-/* Fetch registers from the register section in core bfd. */
-
-static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
- int which, CORE_ADDR reg_addr)
-{
- CoreRegs *regs;
- int regi;
- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
- if (which != 0)
- {
- fprintf_unfiltered
- (gdb_stderr,
- "Gdb error: unknown parameter to fetch_core_registers().\n");
- return;
- }
-
- regs = (CoreRegs *) core_reg_sect;
-
- /* Put the register values from the core file section in the regcache. */
-
- if (ARCH64 ())
- {
- for (regi = 0; regi < ppc_num_gprs; regi++)
- regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi,
- (char *) ®s->r64.gpr[regi]);
-
- if (tdep->ppc_fp0_regnum >= 0)
- for (regi = 0; regi < ppc_num_fprs; regi++)
- regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi,
- (char *) ®s->r64.fpr[regi]);
-
- regcache_raw_supply (current_regcache, PC_REGNUM,
- (char *) ®s->r64.iar);
- regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum,
- (char *) ®s->r64.msr);
- regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
- (char *) ®s->r64.cr);
- regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum,
- (char *) ®s->r64.lr);
- regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum,
- (char *) ®s->r64.ctr);
- regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum,
- (char *) ®s->r64.xer);
- if (tdep->ppc_fpscr_regnum >= 0)
- regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum,
- (char *) ®s->r64.fpscr);
- }
- else
- {
- for (regi = 0; regi < ppc_num_gprs; regi++)
- regcache_raw_supply (current_regcache, tdep->ppc_gp0_regnum + regi,
- (char *) ®s->r32.gpr[regi]);
-
- if (tdep->ppc_fp0_regnum >= 0)
- for (regi = 0; regi < ppc_num_fprs; regi++)
- regcache_raw_supply (current_regcache, tdep->ppc_fp0_regnum + regi,
- (char *) ®s->r32.fpr[regi]);
-
- regcache_raw_supply (current_regcache, PC_REGNUM,
- (char *) ®s->r32.iar);
- regcache_raw_supply (current_regcache, tdep->ppc_ps_regnum,
- (char *) ®s->r32.msr);
- regcache_raw_supply (current_regcache, tdep->ppc_cr_regnum,
- (char *) ®s->r32.cr);
- regcache_raw_supply (current_regcache, tdep->ppc_lr_regnum,
- (char *) ®s->r32.lr);
- regcache_raw_supply (current_regcache, tdep->ppc_ctr_regnum,
- (char *) ®s->r32.ctr);
- regcache_raw_supply (current_regcache, tdep->ppc_xer_regnum,
- (char *) ®s->r32.xer);
- if (tdep->ppc_fpscr_regnum >= 0)
- regcache_raw_supply (current_regcache, tdep->ppc_fpscr_regnum,
- (char *) ®s->r32.fpscr);
- if (tdep->ppc_mq_regnum >= 0)
- regcache_raw_supply (current_regcache, tdep->ppc_mq_regnum,
- (char *) ®s->r32.mq);
- }
-}
-\f
-
-/* Copy information about text and data sections from LDI to VP for a 64-bit
- process if ARCH64 and for a 32-bit process otherwise. */
-
-static void
-vmap_secs (struct vmap *vp, LdInfo *ldi, int arch64)
-{
- if (arch64)
- {
- vp->tstart = (CORE_ADDR) ldi->l64.ldinfo_textorg;
- vp->tend = vp->tstart + ldi->l64.ldinfo_textsize;
- vp->dstart = (CORE_ADDR) ldi->l64.ldinfo_dataorg;
- vp->dend = vp->dstart + ldi->l64.ldinfo_datasize;
- }
- else
- {
- vp->tstart = (unsigned long) ldi->l32.ldinfo_textorg;
- vp->tend = vp->tstart + ldi->l32.ldinfo_textsize;
- vp->dstart = (unsigned long) ldi->l32.ldinfo_dataorg;
- vp->dend = vp->dstart + ldi->l32.ldinfo_datasize;
- }
-
- /* The run time loader maps the file header in addition to the text
- section and returns a pointer to the header in ldinfo_textorg.
- Adjust the text start address to point to the real start address
- of the text section. */
- vp->tstart += vp->toffs;
-}
-
-/* handle symbol translation on vmapping */
-
-static void
-vmap_symtab (struct vmap *vp)
-{
- struct objfile *objfile;
- struct section_offsets *new_offsets;
- int i;