(struct target_section): ... this.
* exec.c: Adjust all references.
* exec.h: Adjust all references.
* nto-tdep.c: Adjust all references.
* nto-tdep.h: Adjust all references.
* ppc-linux-tdep.c: Adjust all references.
* rs6000-nat.c: Adjust all references.
* s390-tdep.c: Adjust all references.
* solib-darwin.c: Adjust all references.
* solib-frv.c: Adjust all references.
* solib-irix.c: Adjust all references.
* solib-null.c: Adjust all references.
* solib-osf.c: Adjust all references.
* solib-pa64.c: Adjust all references.
* solib-som.c: Adjust all references.
* solib-sunos.c: Adjust all references.
* solib-svr4.c: Adjust all references.
* solib-target.c: Adjust all references.
* solib.c: Adjust all references.
* solist.h: Adjust all references.
* symfile.c: Adjust all references.
* symfile.h: Adjust all references.
* target.c: Adjust all references.
+2009-05-22 Pedro Alves <pedro@codesourcery.com>
+
+ * target.h (struct section_table): Rename to ...
+ (struct target_section): ... this.
+ * exec.c: Adjust all references.
+ * exec.h: Adjust all references.
+ * nto-tdep.c: Adjust all references.
+ * nto-tdep.h: Adjust all references.
+ * ppc-linux-tdep.c: Adjust all references.
+ * rs6000-nat.c: Adjust all references.
+ * s390-tdep.c: Adjust all references.
+ * solib-darwin.c: Adjust all references.
+ * solib-frv.c: Adjust all references.
+ * solib-irix.c: Adjust all references.
+ * solib-null.c: Adjust all references.
+ * solib-osf.c: Adjust all references.
+ * solib-pa64.c: Adjust all references.
+ * solib-som.c: Adjust all references.
+ * solib-sunos.c: Adjust all references.
+ * solib-svr4.c: Adjust all references.
+ * solib-target.c: Adjust all references.
+ * solib.c: Adjust all references.
+ * solist.h: Adjust all references.
+ * symfile.c: Adjust all references.
+ * symfile.h: Adjust all references.
+ * target.c: Adjust all references.
+
2009-05-22 Hui Zhu <teawater@gmail.com>
Add sys_fcntl argument interfaces to linux_record_tdep.
add_to_section_table (bfd *abfd, struct bfd_section *asect,
void *table_pp_char)
{
- struct section_table **table_pp = (struct section_table **) table_pp_char;
+ struct target_section **table_pp = (struct target_section **) table_pp_char;
flagword aflag;
/* Check the section flags, but do not discard zero-length sections, since
Returns 0 if OK, 1 on error. */
int
-build_section_table (struct bfd *some_bfd, struct section_table **start,
- struct section_table **end)
+build_section_table (struct bfd *some_bfd, struct target_section **start,
+ struct target_section **end)
{
unsigned count;
count = bfd_count_sections (some_bfd);
if (*start)
xfree (* start);
- *start = (struct section_table *) xmalloc (count * sizeof (**start));
+ *start = (struct target_section *) xmalloc (count * sizeof (**start));
*end = *start;
bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
if (*end > *start + count)
static int
section_table_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
int len, int write,
- struct section_table *sections,
- struct section_table *sections_end,
+ struct target_section *sections,
+ struct target_section *sections_end,
const char *section_name)
{
int res;
- struct section_table *p;
+ struct target_section *p;
CORE_ADDR nextsectaddr, memend;
if (len <= 0)
int
section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len,
- struct section_table *sections,
- struct section_table *sections_end)
+ struct target_section *sections,
+ struct target_section *sections_end)
{
if (readbuf != NULL)
return section_table_xfer_memory (offset, readbuf, len, 0,
void
print_section_info (struct target_ops *t, bfd *abfd)
{
- struct section_table *p;
+ struct target_section *p;
/* FIXME: 16 is not wide enough when gdbarch_addr_bit > 64. */
int wid = gdbarch_addr_bit (gdbarch_from_bfd (abfd)) <= 32 ? 8 : 16;
static void
set_section_command (char *args, int from_tty)
{
- struct section_table *p;
+ struct target_section *p;
char *secname;
unsigned seclen;
unsigned long secaddr;
void
exec_set_section_address (const char *filename, int index, CORE_ADDR address)
{
- struct section_table *p;
+ struct target_section *p;
for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
{
#include "target.h"
-struct section_table;
+struct target_section;
struct target_ops;
struct bfd;
/* Builds a section table, given args BFD, SECTABLE_PTR, SECEND_PTR.
Returns 0 if OK, 1 on error. */
-extern int build_section_table (struct bfd *, struct section_table **,
- struct section_table **);
+extern int build_section_table (struct bfd *, struct target_section **,
+ struct target_section **);
/* Request to transfer up to LEN 8-bit bytes of the target sections
defined by SECTIONS and SECTIONS_END. The OFFSET specifies the
extern int section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
ULONGEST, LONGEST,
- struct section_table *,
- struct section_table *);
+ struct target_section *,
+ struct target_section *);
/* Set the loaded address of a section. */
extern void exec_set_section_address (const char *, int, CORE_ADDR);
}
void
-nto_relocate_section_addresses (struct so_list *so, struct section_table *sec)
+nto_relocate_section_addresses (struct so_list *so, struct target_section *sec)
{
/* Neutrino treats the l_addr base address field in link.h as different than
the base address in the System V ABI and so the offset needs to be
int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
void nto_relocate_section_addresses (struct so_list *,
- struct section_table *);
+ struct target_section *);
int nto_map_arch_to_cputype (const char *);
CORE_ADDR addr,
struct target_ops *targ)
{
- struct section_table *s = target_section_by_addr (targ, addr);
+ struct target_section *s = target_section_by_addr (targ, addr);
/* Check if ADDR points to a function descriptor. */
if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
add our sections to the section table for the core target. */
if (vp != vmap)
{
- struct section_table *stp;
+ struct target_section *stp;
target_resize_to_sections (target, 2);
stp = target->to_sections_end - 2;
we're analyzing the code to unwind past that frame. */
if (pv_is_constant (addr))
{
- struct section_table *secp;
+ struct target_section *secp;
secp = target_section_by_addr (¤t_target, addr.k);
if (secp != NULL
&& (bfd_get_section_flags (secp->bfd, secp->the_bfd_section)
Relocate these VMAs according to solib info. */
static void
darwin_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
sec->addr += so->lm_info->lm_addr;
sec->endaddr += so->lm_info->lm_addr;
static void
frv_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
int seg;
struct int_elf32_fdpic_loadmap *map;
static void
irix_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
sec->addr += so->lm_info->reloc_offset;
sec->endaddr += so->lm_info->reloc_offset;
static void
null_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
}
static void
osf_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
struct lm_info *lmi;
struct lm_sec lms_key, *lms;
static void
pa64_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
asection *asec = sec->the_bfd_section;
CORE_ADDR load_offset;
static void
som_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
flagword aflag = bfd_get_section_flags(so->abfd, sec->the_bfd_section);
static void
sunos_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
sec->addr += LM_ADDR (so);
sec->endaddr += LM_ADDR (so);
static void
svr4_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
sec->addr = svr4_truncate_ptr (sec->addr + LM_ADDR_CHECK (so,
sec->bfd));
static void
solib_target_relocate_section_addresses (struct so_list *so,
- struct section_table *sec)
+ struct target_section *sec)
{
int flags = bfd_get_section_flags (sec->bfd, sec->the_bfd_section);
CORE_ADDR offset;
{
struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
char *filename;
- struct section_table *p;
+ struct target_section *p;
struct cleanup *old_chain;
bfd *abfd;
solib_contains_address_p (const struct so_list *const solib,
CORE_ADDR address)
{
- struct section_table *p;
+ struct target_section *p;
for (p = solib->sections; p < solib->sections_end; p++)
if (p->addr <= address && address < p->endaddr)
char symbols_loaded; /* flag: symbols read in yet? */
char from_tty; /* flag: print msgs? */
struct objfile *objfile; /* objfile for loaded lib */
- struct section_table *sections;
- struct section_table *sections_end;
+ struct target_section *sections;
+ struct target_section *sections_end;
/* Record the range of addresses belonging to this shared library.
There may not be just one (e.g. if two segments are relocated
/* Adjust the section binding addresses by the base address at
which the object was actually mapped. */
void (*relocate_section_addresses) (struct so_list *so,
- struct section_table *);
+ struct target_section *);
/* Free the the link map info and any other private data
structures associated with a so_list entry. */
an existing section table. */
extern struct section_addr_info *
-build_section_addr_info_from_section_table (const struct section_table *start,
- const struct section_table *end)
+build_section_addr_info_from_section_table (const struct target_section *start,
+ const struct target_section *end)
{
struct section_addr_info *sap;
- const struct section_table *stp;
+ const struct target_section *stp;
int oidx;
sap = alloc_section_addr_info (end - start);
#include "symtab.h"
/* Opaque declarations. */
-struct section_table;
+struct target_section;
struct objfile;
struct obj_section;
struct obstack;
existing section table. */
extern struct section_addr_info
- *build_section_addr_info_from_section_table (const struct section_table
+ *build_section_addr_info_from_section_table (const struct target_section
*start,
- const struct section_table
+ const struct target_section
*end);
/* Free all memory allocated by
}
/* Find a section containing ADDR. */
-struct section_table *
+struct target_section *
target_section_by_addr (struct target_ops *target, CORE_ADDR addr)
{
- struct section_table *secp;
+ struct target_section *secp;
for (secp = target->to_sections;
secp < target->to_sections_end;
secp++)
/* Try the executable file, if "trust-readonly-sections" is set. */
if (readbuf != NULL && trust_readonly)
{
- struct section_table *secp;
+ struct target_section *secp;
secp = target_section_by_addr (ops, memaddr);
if (secp != NULL
target_resize_to_sections (struct target_ops *target, int num_added)
{
struct target_ops **t;
- struct section_table *old_value;
+ struct target_section *old_value;
int old_count;
old_value = target->to_sections;
if (target->to_sections)
{
old_count = target->to_sections_end - target->to_sections;
- target->to_sections = (struct section_table *)
+ target->to_sections = (struct target_section *)
xrealloc ((char *) target->to_sections,
- (sizeof (struct section_table)) * (num_added + old_count));
+ (sizeof (struct target_section)) * (num_added + old_count));
}
else
{
old_count = 0;
- target->to_sections = (struct section_table *)
- xmalloc ((sizeof (struct section_table)) * num_added);
+ target->to_sections = (struct target_section *)
+ xmalloc ((sizeof (struct target_section)) * num_added);
}
target->to_sections_end = target->to_sections + (num_added + old_count);
for (t = target_structs; t < target_structs + target_struct_size; t++)
{
- struct section_table *src, *dest;
+ struct target_section *src, *dest;
dest = (*t)->to_sections;
for (src = (*t)->to_sections; src < (*t)->to_sections_end; src++)
int to_has_execution;
int to_has_thread_control; /* control thread execution */
int to_attach_no_wait;
- struct section_table
+ struct target_section
*to_sections;
- struct section_table
+ struct target_section
*to_sections_end;
/* ASYNC target controls */
int (*to_can_async_p) (void);
void target_mark_exited (struct target_ops *);
-/* Struct section_table maps address ranges to file sections. It is
+/* Struct target_section maps address ranges to file sections. It is
mostly used with BFD files, but can be used without (e.g. for handling
raw disks, or files not in formats handled by BFD). */
-struct section_table
+struct target_section
{
CORE_ADDR addr; /* Lowest address in section */
CORE_ADDR endaddr; /* 1+highest address in section */
};
/* Return the "section" containing the specified address. */
-struct section_table *target_section_by_addr (struct target_ops *target,
- CORE_ADDR addr);
-
+struct target_section *target_section_by_addr (struct target_ops *target,
+ CORE_ADDR addr);
/* From mem-break.c */