aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-05-06 14:15:50 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-05-06 14:15:50 +0000
commit4d1eb6b4d299f3e46aab18e08fe4ef3063a39565 (patch)
tree3f3c26c9dc0c529c96fc4d2b5ddfa6ca61fabc1d /gdb/exec.c
parent0c4f667cfe5118bf3a2690502a9a40ff3309abed (diff)
downloadgdb-4d1eb6b4d299f3e46aab18e08fe4ef3063a39565.zip
gdb-4d1eb6b4d299f3e46aab18e08fe4ef3063a39565.tar.gz
gdb-4d1eb6b4d299f3e46aab18e08fe4ef3063a39565.tar.bz2
Reimplement shared library support on ppc-aix...
... using the target_so_ops framework. gdb/ChangeLog: * target.h (TARGET_OBJECT_AIX_LIBRARIES): New target_object enum. * features/library-list-aix.dtd: New file. * solib-aix.h, solib-aix.c: New file. * rs6000-aix-tdep.c: #include "solib.h" and "solib-aix.h". (rs6000_find_toc_address_hook): Delete. (rs6000_push_dummy_call): Rewrite code setting the TOC value. (rs6000_aix_init_osabi): Register solib_aix_so_ops. * rs6000-nat.c: Remove "xcoffsolib.h" include. Include "xml-utils.h". (map_vmap, vmap_exec, vmap_ldinfo, add_vmap, objfile_symbol_add) (vmap_symtab, fixup_breakpoints): Delete. (rs6000_xfer_shared_libraries): New function. (rs6000_xfer_partial): Add TARGET_OBJECT_AIX_LIBRARIES handling. (vmap_secs, bss_data_overlap, vmap_add_symbols): Delete. (xcoff_relocate_symtab, xcoff_relocate_core): Delete. (rs6000_ptrace_ldinfo, rs6000_core_ldinfo) (rs6000_xfer_shared_library): New function. (find_toc_address): Delete. (_initialize_rs6000_nat): Do not set rs6000_find_toc_address_hook. * rs6000-tdep.h (rs6000_find_toc_address_hook): Remove. * xcoffread.c (record_minimal_symbol): Reloate symbol address before creating minimal symbol. Adjust function description accordingly. (scan_xcoff_symtab): Replace call to prim_record_minimal_symbol_and_info by call to record_minimal_symbol. (xcoff_symfile_offsets): Reimplement mostly as a wrapper around default_symfile_offsets. * configure.tgt: Add solib-aix.o to gdb_target_obs for powerpc-aix targets. * config/rs6000/nm-rs6000.h: Delete. * config/powerpc/aix.mh (NAT_FILE): Delete. (NATDEPFILES): Remove xcoffsolib.o. * Makefile.in (XMLFILES): Add library-list-aix.dtd. (ALL_TARGET_OBS): Add solib-aix.o. (HFILES_NO_SRCDIR): Remove xcoffsolib.h and config/rs6000/nm-rs6000.h. Add solib-aix.h. (ALLDEPFILES): Add solib-aix.c. Remove xcoffsolib.c. * xcoffsolib.h, xcoffsolib.c: Delete. * solib.c (reload_shared_libraries): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * breakpoint.c (handle_solib_event): Remove reference to SOLIB_ADD. (disable_breakpoints_in_shlibs): Remove reference to PC_SOLIB. (momentary_bkpt_re_set): Replace SOLIB_ADD by solib_add in comment. * corelow.c (deprecated_core_resize_section_table): Delete. * exec.c: Remove include of xcoffsolib.h". (map_vmap, vmap): Delete. (exec_close_1): Remove references to vmap. (exec_file_attach): Remove vmap handling code, and reference to DEPRECATED_IBM6000_TARGET. (bfdsec_to_vmap): Delete. (exec_files_info): Remove block of code handling VMAP. * infcmd.c (post_create_inferior): Remove reference to SOLIB_CREATE_INFERIOR_HOOK and SOLIB_ADD. * infrun.c (follow_exec): Remove reference to SOLIB_CREATE_INFERIOR_HOOK. * stack.c (print_frame): Remove reference to PC_SOLIB. * solib-dsbt.c (dsbt_current_sos): Adjust comment. (dsbt_relocate_main_executable): Likewise. * solib-frv.c (frv_current_sos): Likewise. gdb/doc/ChangeLog: * gdbint.texinfo (Algorithms): Remove entries documenting DEPRECATED_IBM6000_TARGET, SOLIB_ADD, and SOLIB_CREATE_INFERIOR_HOOK.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c120
1 files changed, 0 insertions, 120 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 3386b60..e8605b9 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -44,10 +44,6 @@
#include <ctype.h>
#include "gdb_stat.h"
-#include "xcoffsolib.h"
-
-struct vmap *map_vmap (bfd *, bfd *);
-
void (*deprecated_file_changed_hook) (char *);
/* Prototypes for local functions */
@@ -81,8 +77,6 @@ show_write_files (struct ui_file *file, int from_tty,
}
-struct vmap *vmap;
-
static void
exec_open (char *args, int from_tty)
{
@@ -117,25 +111,8 @@ exec_close (void)
static void
exec_close_1 (void)
{
- struct vmap *vp, *nxt;
-
using_exec_ops = 0;
- for (nxt = vmap; nxt != NULL;)
- {
- vp = nxt;
- nxt = vp->nxt;
-
- if (vp->objfile)
- free_objfile (vp->objfile);
-
- gdb_bfd_unref (vp->bfd);
-
- xfree (vp);
- }
-
- vmap = NULL;
-
{
struct program_space *ss;
struct cleanup *old_chain;
@@ -248,22 +225,6 @@ exec_file_attach (char *filename, int from_tty)
gdb_bfd_errmsg (bfd_get_error (), matching));
}
- /* FIXME - This should only be run for RS6000, but the ifdef is a poor
- way to accomplish. */
-#ifdef DEPRECATED_IBM6000_TARGET
- /* Setup initial vmap. */
-
- map_vmap (exec_bfd, 0);
- if (vmap == NULL)
- {
- /* Make sure to close exec_bfd, or else "run" might try to use
- it. */
- exec_close ();
- error (_("\"%s\": can't find the file sections: %s"),
- scratch_pathname, bfd_errmsg (bfd_get_error ()));
- }
-#endif /* DEPRECATED_IBM6000_TARGET */
-
if (build_section_table (exec_bfd, &sections, &sections_end))
{
/* Make sure to close exec_bfd, or else "run" might try to use
@@ -507,62 +468,6 @@ remove_target_sections (void *key, bfd *abfd)
}
-static void
-bfdsec_to_vmap (struct bfd *abfd, struct bfd_section *sect, void *arg3)
-{
- struct vmap_and_bfd *vmap_bfd = (struct vmap_and_bfd *) arg3;
- struct vmap *vp;
-
- vp = vmap_bfd->pvmap;
-
- if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0)
- return;
-
- if (strcmp (bfd_section_name (abfd, sect), ".text") == 0)
- {
- vp->tstart = bfd_section_vma (abfd, sect);
- vp->tend = vp->tstart + bfd_section_size (abfd, sect);
- vp->tvma = bfd_section_vma (abfd, sect);
- vp->toffs = sect->filepos;
- }
- else if (strcmp (bfd_section_name (abfd, sect), ".data") == 0)
- {
- vp->dstart = bfd_section_vma (abfd, sect);
- vp->dend = vp->dstart + bfd_section_size (abfd, sect);
- vp->dvma = bfd_section_vma (abfd, sect);
- }
- /* Silently ignore other types of sections. (FIXME?) */
-}
-
-/* Make a vmap for ABFD which might be a member of the archive ARCH.
- Return the new vmap. */
-
-struct vmap *
-map_vmap (bfd *abfd, bfd *arch)
-{
- struct vmap_and_bfd vmap_bfd;
- struct vmap *vp, **vpp;
-
- vp = (struct vmap *) xmalloc (sizeof (*vp));
- memset ((char *) vp, '\0', sizeof (*vp));
- vp->nxt = 0;
- vp->bfd = abfd;
- gdb_bfd_ref (abfd);
- vp->name = bfd_get_filename (arch ? arch : abfd);
- vp->member = arch ? bfd_get_filename (abfd) : "";
-
- vmap_bfd.pbfd = arch;
- vmap_bfd.pvmap = vp;
- bfd_map_over_sections (abfd, bfdsec_to_vmap, &vmap_bfd);
-
- /* Find the end of the list and append. */
- for (vpp = &vmap; *vpp; vpp = &(*vpp)->nxt)
- ;
- *vpp = vp;
-
- return vp;
-}
-
VEC(mem_range_s) *
section_table_available_memory (VEC(mem_range_s) *memory,
@@ -758,31 +663,6 @@ exec_files_info (struct target_ops *t)
print_section_info (current_target_sections, exec_bfd);
else
puts_filtered (_("\t<no file loaded>\n"));
-
- if (vmap)
- {
- int addr_size = gdbarch_addr_bit (target_gdbarch ()) / 8;
- struct vmap *vp;
-
- printf_unfiltered (_("\tMapping info for file `%s'.\n"), vmap->name);
- printf_unfiltered ("\t %*s %*s %*s %*s %8.8s %s\n",
- addr_size * 2, "tstart",
- addr_size * 2, "tend",
- addr_size * 2, "dstart",
- addr_size * 2, "dend",
- "section",
- "file(member)");
-
- for (vp = vmap; vp; vp = vp->nxt)
- printf_unfiltered ("\t0x%s 0x%s 0x%s 0x%s %s%s%s%s\n",
- phex (vp->tstart, addr_size),
- phex (vp->tend, addr_size),
- phex (vp->dstart, addr_size),
- phex (vp->dend, addr_size),
- vp->name,
- *vp->member ? "(" : "", vp->member,
- *vp->member ? ")" : "");
- }
}
static void