/* IBM RS/6000 native-dependent code for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002
- Free Software Foundation, Inc.
+
+ Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ Foundation, Inc.
This file is part of GDB.
#include "arch-utils.h"
#include "language.h" /* for local_hex_string(). */
#include "ppc-tdep.h"
+#include "exec.h"
#include <sys/ptrace.h>
#include <sys/reg.h>
#ifndef ARCH3264
# define ARCH64() 0
#else
-# define ARCH64() (REGISTER_RAW_SIZE (0) == 8)
+# define ARCH64() (DEPRECATED_REGISTER_RAW_SIZE (0) == 8)
#endif
/* Union of 32-bit and 64-bit ".reg" core file sections. */
extern struct vmap *map_vmap (bfd * bf, bfd * arch);
-extern struct target_ops exec_ops;
-
static void vmap_exec (void);
static void vmap_ldinfo (LdInfo *);
even if the register is really only 32 bits. */
long long buf;
rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
- if (REGISTER_RAW_SIZE (regno) == 8)
+ if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
memcpy (addr, &buf, 8);
else
*addr = buf;
/* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
area, even if the register is really only 32 bits. */
long long buf;
- if (REGISTER_RAW_SIZE (regno) == 8)
+ if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
memcpy (&buf, addr, 8);
else
buf = *addr;
static void
vmap_symtab (struct vmap *vp)
{
- register struct objfile *objfile;
+ struct objfile *objfile;
struct section_offsets *new_offsets;
int i;
/* If symbols are not yet loaded, offsets are not yet valid. */
return;
- new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
+ new_offsets =
+ (struct section_offsets *)
+ alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
for (i = 0; i < objfile->num_sections; ++i)
new_offsets->offsets[i] = ANOFFSET (objfile->section_offsets, i);
add_vmap (LdInfo *ldi)
{
bfd *abfd, *last;
- register char *mem, *objname, *filename;
+ char *mem, *objname, *filename;
struct objfile *obj;
struct vmap *vp;
int fd;
last = 0;
/* FIXME??? am I tossing BFDs? bfd? */
while ((last = bfd_openr_next_archived_file (abfd, last)))
- if (STREQ (mem, last->filename))
+ if (DEPRECATED_STREQ (mem, last->filename))
break;
if (!last)
vmap_ldinfo (LdInfo *ldi)
{
struct stat ii, vi;
- register struct vmap *vp;
+ struct vmap *vp;
int got_one, retried;
int got_exec_file = 0;
uint next;
/* The filenames are not always sufficient to match on. */
- if ((name[0] == '/' && !STREQ (name, vp->name))
- || (memb[0] && !STREQ (memb, vp->member)))
+ if ((name[0] == '/' && !DEPRECATED_STREQ (name, vp->name))
+ || (memb[0] && !DEPRECATED_STREQ (memb, vp->member)))
continue;
/* See if we are referring to the same file.
/* Announce new object files. Doing this after symbol relocation
makes aix-thread.c's job easier. */
- if (target_new_objfile_hook && vp->objfile)
- target_new_objfile_hook (vp->objfile);
+ if (deprecated_target_new_objfile_hook && vp->objfile)
+ deprecated_target_new_objfile_hook (vp->objfile);
/* There may be more, so we don't break out of the loop. */
}
for (i = 0; &exec_ops.to_sections[i] < exec_ops.to_sections_end; i++)
{
- if (STREQ (".text", exec_ops.to_sections[i].the_bfd_section->name))
+ if (DEPRECATED_STREQ (".text", exec_ops.to_sections[i].the_bfd_section->name))
{
exec_ops.to_sections[i].addr += vmap->tstart - vmap->tvma;
exec_ops.to_sections[i].endaddr += vmap->tstart - vmap->tvma;
}
- else if (STREQ (".data", exec_ops.to_sections[i].the_bfd_section->name))
+ else if (DEPRECATED_STREQ (".data", exec_ops.to_sections[i].the_bfd_section->name))
{
exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
}
- else if (STREQ (".bss", exec_ops.to_sections[i].the_bfd_section->name))
+ else if (DEPRECATED_STREQ (".bss", exec_ops.to_sections[i].the_bfd_section->name))
{
exec_ops.to_sections[i].addr += vmap->dstart - vmap->dvma;
exec_ops.to_sections[i].endaddr += vmap->dstart - vmap->dvma;
gdbarch_info_init (&info);
info.bfd_arch_info = bfd_get_arch_info (&abfd);
+ info.abfd = exec_bfd;
if (!gdbarch_update_p (info))
{
void
xcoff_relocate_core (struct target_ops *target)
{
- sec_ptr ldinfo_sec;
+ struct bfd_section *ldinfo_sec;
int offset = 0;
LdInfo *ldi;
struct vmap *vp;
vmap_symtab (vp);
- if (target_new_objfile_hook && vp != vmap && vp->objfile)
- target_new_objfile_hook (vp->objfile);
+ if (deprecated_target_new_objfile_hook && vp != vmap && vp->objfile)
+ deprecated_target_new_objfile_hook (vp->objfile);
}
while (LDI_NEXT (ldi, arch64) != 0);
vmap_exec ();
starting a child process. */
rs6000_set_host_arch_hook = set_host_arch;
- add_core_fns (&rs6000_core_fns);
+ deprecated_add_core_fns (&rs6000_core_fns);
}