1999-08-24 00:40:00 +02:00
|
|
|
/* Handle HP ELF shared libraries for GDB, the GNU Debugger.
|
2002-06-08 22:02:51 +02:00
|
|
|
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-07 19:29:54 +01:00
|
|
|
Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
|
2003-10-23 05:01:55 +02:00
|
|
|
Inc.
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
HP in their infinite stupidity choose not to use standard ELF dynamic
|
|
|
|
linker interfaces. They also choose not to make their ELF dymamic
|
|
|
|
linker interfaces compatible with the SOM dynamic linker. The
|
|
|
|
net result is we can not use either of the existing somsolib.c or
|
|
|
|
solib.c. What a crock.
|
|
|
|
|
|
|
|
Even more disgusting. This file depends on functions provided only
|
|
|
|
in certain PA64 libraries. Thus this file is supposed to only be
|
|
|
|
used native. When will HP ever learn that they need to provide the
|
|
|
|
same functionality in all their libraries! */
|
|
|
|
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#include <elf.h>
|
|
|
|
#include <elf_hp.h>
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
|
|
|
#include "frame.h"
|
|
|
|
#include "bfd.h"
|
|
|
|
#include "libhppa.h"
|
|
|
|
#include "gdbcore.h"
|
|
|
|
#include "symtab.h"
|
|
|
|
#include "breakpoint.h"
|
|
|
|
#include "symfile.h"
|
|
|
|
#include "objfiles.h"
|
|
|
|
#include "inferior.h"
|
|
|
|
#include "gdb-stabs.h"
|
|
|
|
#include "gdb_stat.h"
|
|
|
|
#include "gdbcmd.h"
|
|
|
|
#include "language.h"
|
2001-03-01 02:39:22 +01:00
|
|
|
#include "regcache.h"
|
2003-10-23 05:01:55 +02:00
|
|
|
#include "exec.h"
|
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.c (hppa_objfile_priv_data): New.
(SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use
HPPA_INSTRUCTION_SIZE.
(read_unwind_info): Use objfile_data to reference unwind info.
(find_unwind_entry): Likewise.
(hpread_adjust_stack_address): Move to hpread.c.
(_initialize_hppa_tdep): Register hppa objfile data.
* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define.
(unwind_table_entry, unwind_stub_types): Move from tm-hppa.h.
(obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename
with hppa_ prefix.
* hpread.c (hppa-tdep.h): Include.
(hpread_adjust_stack_address): Move from hppa-tdep.c.
(hpread_read_function_type, hpread_read_doc_function_type)
(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address
directly. Use objfile_data to access solib data.
* pa64solib.c (hppa-tdep.h): Include.
(pa64_solib_add_solib_objfile): Use objfile_data to access solib data.
* somsolib.c (hppa-tdep.h): Include.
(som_solib_add_solib_objfile): Use objfile_data to access solib data.
* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type)
(inferior_status): Remove unused forward declarations.
(INSTRUCTION_SIZE): Move to hppa-tdep.c.
(unwind_table_entry, unwind_stub_types, obj_unwind_info)
(obj_private_struct): Move to hppa-tdep.h.
(HPREAD_ADJUST_STACK_ADDRESS): Remove.
2004-04-17 19:19:29 +02:00
|
|
|
#include "hppa-tdep.h"
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
|
|
|
#ifndef O_BINARY
|
|
|
|
#define O_BINARY 0
|
|
|
|
#endif
|
|
|
|
|
2000-05-28 03:12:42 +02:00
|
|
|
static CORE_ADDR bfd_lookup_symbol (bfd *, char *);
|
1999-08-24 00:40:00 +02:00
|
|
|
/* This lives in hppa-tdep.c. */
|
2000-05-28 03:12:42 +02:00
|
|
|
extern struct unwind_table_entry *find_unwind_entry (CORE_ADDR pc);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* These ought to be defined in some public interface, but aren't. They
|
|
|
|
identify dynamic linker events. */
|
|
|
|
#define DLD_CB_LOAD 1
|
|
|
|
#define DLD_CB_UNLOAD 0
|
|
|
|
|
|
|
|
/* A structure to keep track of all the known shared objects. */
|
|
|
|
struct so_list
|
|
|
|
{
|
|
|
|
bfd *abfd;
|
|
|
|
char *name;
|
|
|
|
struct so_list *next;
|
|
|
|
struct objfile *objfile;
|
|
|
|
CORE_ADDR pa64_solib_desc_addr;
|
|
|
|
struct load_module_desc pa64_solib_desc;
|
|
|
|
struct section_table *sections;
|
|
|
|
struct section_table *sections_end;
|
2002-12-04 18:53:26 +01:00
|
|
|
int loaded;
|
1999-08-24 00:40:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static struct so_list *so_list_head;
|
|
|
|
|
|
|
|
/* This is the cumulative size in bytes of the symbol tables of all
|
|
|
|
shared objects on the so_list_head list. (When we say size, here
|
|
|
|
we mean of the information before it is brought into memory and
|
|
|
|
potentially expanded by GDB.) When adding a new shlib, this value
|
2001-10-30 05:05:36 +01:00
|
|
|
is compared against a threshold size, held by auto_solib_limit (in
|
|
|
|
megabytes). If adding symbols for the new shlib would cause the
|
|
|
|
total size to exceed the threshold, then the new shlib's symbols
|
|
|
|
are not loaded. */
|
1999-08-24 00:40:00 +02:00
|
|
|
static LONGEST pa64_solib_total_st_size;
|
|
|
|
|
|
|
|
/* When the threshold is reached for any shlib, we refuse to add
|
|
|
|
symbols for subsequent shlibs, even if those shlibs' symbols would
|
2001-10-30 05:05:36 +01:00
|
|
|
be small enough to fit under the threshold. Although this may
|
1999-08-24 00:40:00 +02:00
|
|
|
result in one, early large shlib preventing the loading of later,
|
2001-10-30 05:05:36 +01:00
|
|
|
smaller shlibs' symbols, it allows us to issue one informational
|
1999-08-24 00:40:00 +02:00
|
|
|
message. The alternative, to issue a message for each shlib whose
|
|
|
|
symbols aren't loaded, could be a big annoyance where the threshold
|
2001-10-30 05:05:36 +01:00
|
|
|
is exceeded due to a very large number of shlibs. */
|
1999-08-24 00:40:00 +02:00
|
|
|
static int pa64_solib_st_size_threshold_exceeded;
|
|
|
|
|
|
|
|
/* When adding fields, be sure to clear them in _initialize_pa64_solib. */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
CORE_ADDR dld_flags_addr;
|
2002-06-08 22:02:51 +02:00
|
|
|
LONGEST dld_flags;
|
2003-11-06 03:52:28 +01:00
|
|
|
struct bfd_section *dyninfo_sect;
|
2002-12-04 18:53:26 +01:00
|
|
|
int have_read_dld_descriptor;
|
|
|
|
int is_valid;
|
1999-08-24 00:40:00 +02:00
|
|
|
CORE_ADDR load_map;
|
|
|
|
CORE_ADDR load_map_addr;
|
|
|
|
struct load_module_desc dld_desc;
|
|
|
|
}
|
|
|
|
dld_cache_t;
|
|
|
|
|
|
|
|
static dld_cache_t dld_cache;
|
|
|
|
|
2000-05-28 03:12:42 +02:00
|
|
|
static void pa64_sharedlibrary_info_command (char *, int);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2000-05-28 03:12:42 +02:00
|
|
|
static void pa64_solib_sharedlibrary_command (char *, int);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2000-05-28 03:12:42 +02:00
|
|
|
static void *pa64_target_read_memory (void *, CORE_ADDR, size_t, int);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2002-12-04 18:53:26 +01:00
|
|
|
static int read_dld_descriptor (struct target_ops *, int readsyms);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2002-12-04 18:53:26 +01:00
|
|
|
static int read_dynamic_info (asection *, dld_cache_t *);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2002-12-04 18:53:26 +01:00
|
|
|
static void add_to_solist (int, char *, int, struct load_module_desc *,
|
2000-05-28 03:12:42 +02:00
|
|
|
CORE_ADDR, struct target_ops *);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* When examining the shared library for debugging information we have to
|
|
|
|
look for HP debug symbols, stabs and dwarf2 debug symbols. */
|
|
|
|
static char *pa64_debug_section_names[] = {
|
|
|
|
".debug_header", ".debug_gntt", ".debug_lntt", ".debug_slt", ".debug_vt",
|
|
|
|
".stabs", ".stabstr", ".debug_info", ".debug_abbrev", ".debug_aranges",
|
|
|
|
".debug_macinfo", ".debug_line", ".debug_loc", ".debug_pubnames",
|
|
|
|
".debug_str", NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Return a ballbark figure for the amount of memory GDB will need to
|
|
|
|
allocate to read in the debug symbols from FILENAME. */
|
|
|
|
static LONGEST
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_sizeof_symbol_table (char *filename)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
bfd *abfd;
|
|
|
|
int i;
|
|
|
|
int desc;
|
|
|
|
char *absolute_name;
|
|
|
|
LONGEST st_size = (LONGEST) 0;
|
|
|
|
asection *sect;
|
|
|
|
|
|
|
|
/* We believe that filename was handed to us by the dynamic linker, and
|
|
|
|
is therefore always an absolute path. */
|
2004-07-30 21:17:20 +02:00
|
|
|
desc = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
|
|
|
|
O_RDONLY | O_BINARY, 0, &absolute_name);
|
1999-08-24 00:40:00 +02:00
|
|
|
if (desc < 0)
|
|
|
|
{
|
|
|
|
perror_with_name (filename);
|
|
|
|
}
|
|
|
|
filename = absolute_name;
|
|
|
|
|
|
|
|
abfd = bfd_fdopenr (filename, gnutarget, desc);
|
|
|
|
if (!abfd)
|
|
|
|
{
|
|
|
|
close (desc);
|
2000-12-15 02:01:51 +01:00
|
|
|
make_cleanup (xfree, filename);
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("\"%s\": can't open to read symbols: %s."), filename,
|
1999-08-24 00:40:00 +02:00
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bfd_check_format (abfd, bfd_object))
|
|
|
|
{
|
|
|
|
bfd_close (abfd);
|
2000-12-15 02:01:51 +01:00
|
|
|
make_cleanup (xfree, filename);
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("\"%s\": can't read symbols: %s."), filename,
|
1999-08-24 00:40:00 +02:00
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Sum the sizes of the various sections that compose debug info. */
|
|
|
|
for (i = 0; pa64_debug_section_names[i] != NULL; i++)
|
|
|
|
{
|
|
|
|
asection *sect;
|
|
|
|
|
|
|
|
sect = bfd_get_section_by_name (abfd, pa64_debug_section_names[i]);
|
|
|
|
if (sect)
|
|
|
|
st_size += (LONGEST)bfd_section_size (abfd, sect);
|
|
|
|
}
|
|
|
|
|
|
|
|
bfd_close (abfd);
|
2000-12-15 02:01:51 +01:00
|
|
|
xfree (filename);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* Unfortunately, just summing the sizes of various debug info
|
|
|
|
sections isn't a very accurate measurement of how much heap
|
|
|
|
space the debugger will need to hold them. It also doesn't
|
|
|
|
account for space needed by linker (aka "minimal") symbols.
|
|
|
|
|
|
|
|
Anecdotal evidence suggests that just summing the sizes of
|
|
|
|
debug-info-related sections understates the heap space needed
|
|
|
|
to represent it internally by about an order of magnitude.
|
|
|
|
|
|
|
|
Since it's not exactly brain surgery we're doing here, rather
|
|
|
|
than attempt to more accurately measure the size of a shlib's
|
|
|
|
symbol table in GDB's heap, we'll just apply a 10x fudge-
|
|
|
|
factor to the debug info sections' size-sum. No, this doesn't
|
|
|
|
account for minimal symbols in non-debuggable shlibs. But it
|
|
|
|
all roughly washes out in the end. */
|
|
|
|
return st_size * (LONGEST) 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add a shared library to the objfile list and load its symbols into
|
|
|
|
GDB's symbol table. */
|
|
|
|
static void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_add_solib_objfile (struct so_list *so, char *name, int from_tty,
|
|
|
|
CORE_ADDR text_addr)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
bfd *tmp_bfd;
|
|
|
|
asection *sec;
|
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.c (hppa_objfile_priv_data): New.
(SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use
HPPA_INSTRUCTION_SIZE.
(read_unwind_info): Use objfile_data to reference unwind info.
(find_unwind_entry): Likewise.
(hpread_adjust_stack_address): Move to hpread.c.
(_initialize_hppa_tdep): Register hppa objfile data.
* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define.
(unwind_table_entry, unwind_stub_types): Move from tm-hppa.h.
(obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename
with hppa_ prefix.
* hpread.c (hppa-tdep.h): Include.
(hpread_adjust_stack_address): Move from hppa-tdep.c.
(hpread_read_function_type, hpread_read_doc_function_type)
(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address
directly. Use objfile_data to access solib data.
* pa64solib.c (hppa-tdep.h): Include.
(pa64_solib_add_solib_objfile): Use objfile_data to access solib data.
* somsolib.c (hppa-tdep.h): Include.
(som_solib_add_solib_objfile): Use objfile_data to access solib data.
* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type)
(inferior_status): Remove unused forward declarations.
(INSTRUCTION_SIZE): Move to hppa-tdep.c.
(unwind_table_entry, unwind_stub_types, obj_unwind_info)
(obj_private_struct): Move to hppa-tdep.h.
(HPREAD_ADJUST_STACK_ADDRESS): Remove.
2004-04-17 19:19:29 +02:00
|
|
|
struct hppa_objfile_private *obj_private;
|
2003-06-07 01:33:00 +02:00
|
|
|
struct section_addr_info *section_addrs;
|
|
|
|
struct cleanup *my_cleanups;
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* We need the BFD so that we can look at its sections. We open up the
|
|
|
|
file temporarily, then close it when we are done. */
|
|
|
|
tmp_bfd = bfd_openr (name, gnutarget);
|
|
|
|
if (tmp_bfd == NULL)
|
|
|
|
{
|
|
|
|
perror_with_name (name);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!bfd_check_format (tmp_bfd, bfd_object))
|
|
|
|
{
|
|
|
|
bfd_close (tmp_bfd);
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("\"%s\" is not an object file: %s"), name,
|
1999-08-24 00:40:00 +02:00
|
|
|
bfd_errmsg (bfd_get_error ()));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Undo some braindamage from symfile.c.
|
|
|
|
|
|
|
|
First, symfile.c will subtract the VMA of the first .text section
|
|
|
|
in the shared library that it finds. Undo that. */
|
|
|
|
sec = bfd_get_section_by_name (tmp_bfd, ".text");
|
|
|
|
text_addr += bfd_section_vma (tmp_bfd, sec);
|
|
|
|
|
|
|
|
/* Now find the true lowest section in the shared library. */
|
|
|
|
sec = NULL;
|
2002-06-08 22:02:51 +02:00
|
|
|
bfd_map_over_sections (tmp_bfd, find_lowest_section, &sec);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
if (sec)
|
|
|
|
{
|
|
|
|
/* Subtract out the VMA of the lowest section. */
|
|
|
|
text_addr -= bfd_section_vma (tmp_bfd, sec);
|
|
|
|
|
|
|
|
/* ??? Add back in the filepos of that lowest section. */
|
|
|
|
text_addr += sec->filepos;
|
|
|
|
}
|
|
|
|
|
2003-06-07 01:33:00 +02:00
|
|
|
section_addrs = alloc_section_addr_info (bfd_count_sections (tmp_bfd));
|
|
|
|
my_cleanups = make_cleanup (xfree, section_addrs);
|
|
|
|
|
1999-08-24 00:40:00 +02:00
|
|
|
/* We are done with the temporary bfd. Get rid of it and make sure
|
|
|
|
nobody else can us it. */
|
|
|
|
bfd_close (tmp_bfd);
|
|
|
|
tmp_bfd = NULL;
|
|
|
|
|
|
|
|
/* Now let the generic code load up symbols for this library. */
|
2003-06-07 01:33:00 +02:00
|
|
|
section_addrs->other[0].addr = text_addr;
|
|
|
|
section_addrs->other[0].name = ".text";
|
|
|
|
so->objfile = symbol_file_add (name, from_tty, section_addrs, 0, OBJF_SHARED);
|
1999-08-24 00:40:00 +02:00
|
|
|
so->abfd = so->objfile->obfd;
|
|
|
|
|
|
|
|
/* Mark this as a shared library and save private data. */
|
|
|
|
so->objfile->flags |= OBJF_SHARED;
|
|
|
|
|
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.c (hppa_objfile_priv_data): New.
(SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use
HPPA_INSTRUCTION_SIZE.
(read_unwind_info): Use objfile_data to reference unwind info.
(find_unwind_entry): Likewise.
(hpread_adjust_stack_address): Move to hpread.c.
(_initialize_hppa_tdep): Register hppa objfile data.
* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define.
(unwind_table_entry, unwind_stub_types): Move from tm-hppa.h.
(obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename
with hppa_ prefix.
* hpread.c (hppa-tdep.h): Include.
(hpread_adjust_stack_address): Move from hppa-tdep.c.
(hpread_read_function_type, hpread_read_doc_function_type)
(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address
directly. Use objfile_data to access solib data.
* pa64solib.c (hppa-tdep.h): Include.
(pa64_solib_add_solib_objfile): Use objfile_data to access solib data.
* somsolib.c (hppa-tdep.h): Include.
(som_solib_add_solib_objfile): Use objfile_data to access solib data.
* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type)
(inferior_status): Remove unused forward declarations.
(INSTRUCTION_SIZE): Move to hppa-tdep.c.
(unwind_table_entry, unwind_stub_types, obj_unwind_info)
(obj_private_struct): Move to hppa-tdep.h.
(HPREAD_ADJUST_STACK_ADDRESS): Remove.
2004-04-17 19:19:29 +02:00
|
|
|
obj_private = (struct hppa_objfile_private *)
|
|
|
|
objfile_data (so->objfile, hppa_objfile_priv_data);
|
|
|
|
if (obj_private == NULL)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.c (hppa_objfile_priv_data): New.
(SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use
HPPA_INSTRUCTION_SIZE.
(read_unwind_info): Use objfile_data to reference unwind info.
(find_unwind_entry): Likewise.
(hpread_adjust_stack_address): Move to hpread.c.
(_initialize_hppa_tdep): Register hppa objfile data.
* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define.
(unwind_table_entry, unwind_stub_types): Move from tm-hppa.h.
(obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename
with hppa_ prefix.
* hpread.c (hppa-tdep.h): Include.
(hpread_adjust_stack_address): Move from hppa-tdep.c.
(hpread_read_function_type, hpread_read_doc_function_type)
(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address
directly. Use objfile_data to access solib data.
* pa64solib.c (hppa-tdep.h): Include.
(pa64_solib_add_solib_objfile): Use objfile_data to access solib data.
* somsolib.c (hppa-tdep.h): Include.
(som_solib_add_solib_objfile): Use objfile_data to access solib data.
* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type)
(inferior_status): Remove unused forward declarations.
(INSTRUCTION_SIZE): Move to hppa-tdep.c.
(unwind_table_entry, unwind_stub_types, obj_unwind_info)
(obj_private_struct): Move to hppa-tdep.h.
(HPREAD_ADJUST_STACK_ADDRESS): Remove.
2004-04-17 19:19:29 +02:00
|
|
|
obj_private = (struct hppa_objfile_private *)
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* dbxread.c (dbx_symfile_init, start_psymtab, end_psymtab,
coffstab_build_psymtabs, elfstab_build_psymtabs)
(stabsect_build_psymtabs): Replace psymbol_obstack with
objfile_obstack.
* dwarf2-frame.c (decode_frame_entry_1): Ditto.
* dwarf2read.c (dwarf2_build_psymtabs_hard, dwarf2_read_section):
Ditto.
* dwarfread.c (scan_compilation_units): Ditto.
* elfread.c (elfstab_offset_sections): Ditto.
* hppa-tdep.c (read_unwind_info): Ditto.
* hpread.c (hpread_build_psymtabs, hpread_start_psymtab)
(hpread_end_psymtab): Ditto.
* mdebugread.c (mdebug_build_psymtabs, add_pending)
(parse_partial_symbols, new_psymtab, elfmdebug_build_psymtabs):
Ditto.
* mips-tdep.c (non_heuristic_proc_desc): Ditto.
* objfiles.c (add_to_objfile_sections)
(build_objfile_section_table): Ditto.
(allocate_objfile): Remove init of psymbol_obstack.
(free_objfile): Remove freeing of psymbol_obstack.
* objfiles.h (struct objfile): Remove field
psymbol_obstack. Update comments.
* pa64solib.c (pa64_solib_add_solib_objfile): Replace
psymbol_obstack with objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
psymbol_obstack.
* somread.c (som_symfile_offsets, init_import_symbols)
(init_export_symbols): Replace psymbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add_solib_objfile): Ditto.
* symfile.c (default_symfile_offsets, syms_from_objfile)
(reread_symbols): Remove freeing and init of psymbol_obstack.
(cashier_psymtab): Update comment.
* symmisc.c (print_objfile_statistics): Don't report stats for
psymbol obstack.
* symtab.h (struct general_symbol_info, struct partial_symtab):
Update comments.
* xcoffread.c (xcoff_start_psymtab, xcoff_end_psymtab, swap_sym)
(xcoff_symfile_offsets): Replace psymbol_obstack with
objfile_obstack.
2004-02-07 19:29:54 +01:00
|
|
|
obstack_alloc (&so->objfile->objfile_obstack,
|
2004-04-17 Randolph Chung <tausq@debian.org>
* Makefile.in (hpread.o, pa64solib.o, somsolib.o): Add $(hppa_tdep_h)
* hppa-tdep.c (hppa_objfile_priv_data): New.
(SR4EXPORT_LDIL_OFFSET, SR4EXPORT_LDO_OFFSET): Use
HPPA_INSTRUCTION_SIZE.
(read_unwind_info): Use objfile_data to reference unwind info.
(find_unwind_entry): Likewise.
(hpread_adjust_stack_address): Move to hpread.c.
(_initialize_hppa_tdep): Register hppa objfile data.
* hppa-tdep.h (HPPA_INSTRUCTION_SIZE): Define.
(unwind_table_entry, unwind_stub_types): Move from tm-hppa.h.
(obj_unwind_info, obj_private_struct): Move from tm-hppa.h, and rename
with hppa_ prefix.
* hpread.c (hppa-tdep.h): Include.
(hpread_adjust_stack_address): Move from hppa-tdep.c.
(hpread_read_function_type, hpread_read_doc_function_type)
(hpread_process_one_debug_symbol): Call hpread_adjust_stack_address
directly. Use objfile_data to access solib data.
* pa64solib.c (hppa-tdep.h): Include.
(pa64_solib_add_solib_objfile): Use objfile_data to access solib data.
* somsolib.c (hppa-tdep.h): Include.
(som_solib_add_solib_objfile): Use objfile_data to access solib data.
* config/pa/tm-hppa.h (frame_info, frame_saved_regs, value, type)
(inferior_status): Remove unused forward declarations.
(INSTRUCTION_SIZE): Move to hppa-tdep.c.
(unwind_table_entry, unwind_stub_types, obj_unwind_info)
(obj_private_struct): Move to hppa-tdep.h.
(HPREAD_ADJUST_STACK_ADDRESS): Remove.
2004-04-17 19:19:29 +02:00
|
|
|
sizeof (struct hppa_objfile_private));
|
|
|
|
set_objfile_data (so->objfile, hppa_objfile_priv_data, obj_private);
|
1999-08-24 00:40:00 +02:00
|
|
|
obj_private->unwind_info = NULL;
|
|
|
|
obj_private->so_info = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
obj_private->so_info = so;
|
|
|
|
obj_private->dp = so->pa64_solib_desc.linkage_ptr;
|
2003-06-07 01:33:00 +02:00
|
|
|
do_cleanups (my_cleanups);
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Load debugging information for a shared library. TARGET may be
|
|
|
|
NULL if we are not attaching to a process or reading a core file. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_load_symbols (struct so_list *so, char *name, int from_tty,
|
|
|
|
CORE_ADDR text_addr, struct target_ops *target)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct section_table *p;
|
|
|
|
asection *sec;
|
|
|
|
int status;
|
|
|
|
char buf[4];
|
|
|
|
CORE_ADDR presumed_data_start;
|
|
|
|
|
|
|
|
if (text_addr == 0)
|
|
|
|
text_addr = so->pa64_solib_desc.text_base;
|
|
|
|
|
|
|
|
pa64_solib_add_solib_objfile (so, name, from_tty, text_addr);
|
|
|
|
|
|
|
|
/* Now we need to build a section table for this library since
|
|
|
|
we might be debugging a core file from a dynamically linked
|
|
|
|
executable in which the libraries were not privately mapped. */
|
|
|
|
if (build_section_table (so->abfd,
|
|
|
|
&so->sections,
|
|
|
|
&so->sections_end))
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Unable to build section table for shared library\n."));
|
1999-08-24 00:40:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-08-28 00:30:29 +02:00
|
|
|
(so->objfile->section_offsets)->offsets[SECT_OFF_TEXT (so->objfile)]
|
1999-08-24 00:40:00 +02:00
|
|
|
= so->pa64_solib_desc.text_base;
|
2000-08-28 00:30:29 +02:00
|
|
|
(so->objfile->section_offsets)->offsets[SECT_OFF_DATA (so->objfile)]
|
1999-08-24 00:40:00 +02:00
|
|
|
= so->pa64_solib_desc.data_base;
|
|
|
|
|
|
|
|
/* Relocate all the sections based on where they got loaded. */
|
|
|
|
for (p = so->sections; p < so->sections_end; p++)
|
|
|
|
{
|
|
|
|
if (p->the_bfd_section->flags & SEC_CODE)
|
|
|
|
{
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-04 18:52:34 +02:00
|
|
|
p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
|
|
|
|
p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
else if (p->the_bfd_section->flags & SEC_DATA)
|
|
|
|
{
|
Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Define as functions of OBJFILE. Add
sect_index_text, sect_index_data, sect_index_rodata,
sect_index_bss to objfile structure.
* gdb-stabs.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS,
SECT_OFF_RODATA): Remove.
* objfiles.c (allocate_objfile): Initialize
sect_index_{text,data,bss,rodata} to -1, for error detection.
* symfile.c (default_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata} from bfd information.
* xcoffread.c (xcoff_symfile_offsets): Ditto.
* somread.c (som_symfile_offsets): Initialize
sect_index_{text,data,bss,rodata}.
* coffread.c, dbxread.c, elfread.c, hp-psymtab-read.c,
hp-symtab-read.c, hpread.c, mdebugread.c, minsyms.c,
mipsread.c, objfiles.c, os9kread.c, pa64solib.c, partial-stab.h,
remote-os9k.c, remote-vx.c, remote.c, rs6000-nat.c, somsolib.c,
stabsread.c, symfile.c, xcoffread.c:
Update use of SECT_OFF_{TEXT,DATA,BSS,RODATA} to depend on the
current objfile.
* xcoffread.c: Add new field objfile to find_targ_sec_arg.
2000-05-04 18:52:34 +02:00
|
|
|
p->addr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
|
|
|
|
p->endaddr += ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now see if we need to map in the text and data for this shared
|
|
|
|
library (for example debugging a core file which does not use
|
|
|
|
private shared libraries.).
|
|
|
|
|
|
|
|
Carefully peek at the first text address in the library. If the
|
|
|
|
read succeeds, then the libraries were privately mapped and were
|
|
|
|
included in the core dump file.
|
|
|
|
|
|
|
|
If the peek failed, then the libraries were not privately mapped
|
|
|
|
and are not in the core file, we'll have to read them in ourselves. */
|
|
|
|
status = target_read_memory (text_addr, buf, 4);
|
|
|
|
if (status != 0)
|
|
|
|
{
|
1999-09-28 23:55:21 +02:00
|
|
|
int new, old;
|
|
|
|
|
1999-08-24 00:40:00 +02:00
|
|
|
new = so->sections_end - so->sections;
|
|
|
|
|
1999-09-28 23:55:21 +02:00
|
|
|
old = target_resize_to_sections (target, new);
|
|
|
|
|
1999-08-24 00:40:00 +02:00
|
|
|
/* Copy over the old data before it gets clobbered. */
|
|
|
|
memcpy ((char *) (target->to_sections + old),
|
|
|
|
so->sections,
|
|
|
|
((sizeof (struct section_table)) * new));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Add symbols from shared libraries into the symtab list, unless the
|
2001-10-30 05:05:36 +01:00
|
|
|
size threshold specified by auto_solib_limit (in megabytes) would
|
1999-08-24 00:40:00 +02:00
|
|
|
be exceeded. */
|
|
|
|
|
|
|
|
void
|
2001-11-01 17:17:08 +01:00
|
|
|
pa64_solib_add (char *arg_string, int from_tty, struct target_ops *target, int readsyms)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct minimal_symbol *msymbol;
|
|
|
|
CORE_ADDR addr;
|
|
|
|
asection *shlib_info;
|
|
|
|
int status;
|
|
|
|
unsigned int dld_flags;
|
|
|
|
char buf[4], *re_err;
|
|
|
|
int threshold_warning_given = 0;
|
|
|
|
int dll_index;
|
|
|
|
struct load_module_desc dll_desc;
|
|
|
|
char *dll_path;
|
|
|
|
|
|
|
|
/* First validate our arguments. */
|
|
|
|
if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Invalid regexp: %s"), re_err);
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If we're debugging a core file, or have attached to a running
|
|
|
|
process, then pa64_solib_create_inferior_hook will not have been
|
|
|
|
called.
|
|
|
|
|
|
|
|
We need to first determine if we're dealing with a dynamically
|
|
|
|
linked executable. If not, then return without an error or warning.
|
|
|
|
|
2005-01-14 02:01:34 +01:00
|
|
|
We also need to examine __dld_flags to determine if the shared
|
|
|
|
library list is valid and to determine if the libraries have been
|
|
|
|
privately mapped. */
|
1999-08-24 00:40:00 +02:00
|
|
|
if (symfile_objfile == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* First see if the objfile was dynamically linked. */
|
|
|
|
shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, ".dynamic");
|
|
|
|
if (!shlib_info)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* It's got a .dynamic section, make sure it's not empty. */
|
|
|
|
if (bfd_section_size (symfile_objfile->obfd, shlib_info) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Read in the load map pointer if we have not done so already. */
|
|
|
|
if (! dld_cache.have_read_dld_descriptor)
|
2001-11-01 17:17:08 +01:00
|
|
|
if (! read_dld_descriptor (target, readsyms))
|
1999-08-24 00:40:00 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* If the libraries were not mapped private, warn the user. */
|
|
|
|
if ((dld_cache.dld_flags & DT_HP_DEBUG_PRIVATE) == 0)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
warning (_("\
|
|
|
|
The shared libraries were not privately mapped; setting a\n\
|
|
|
|
breakpoint in a shared library will not work until you rerun the program."));
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* For each shaerd library, add it to the shared library list. */
|
|
|
|
for (dll_index = 1; ; dll_index++)
|
|
|
|
{
|
|
|
|
/* Read in the load module descriptor. */
|
|
|
|
if (dlgetmodinfo (dll_index, &dll_desc, sizeof (dll_desc),
|
|
|
|
pa64_target_read_memory, 0, dld_cache.load_map)
|
|
|
|
== 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Get the name of the shared library. */
|
|
|
|
dll_path = (char *)dlgetname (&dll_desc, sizeof (dll_desc),
|
|
|
|
pa64_target_read_memory,
|
|
|
|
0, dld_cache.load_map);
|
|
|
|
|
|
|
|
if (!dll_path)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("pa64_solib_add, unable to read shared library path."));
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2001-11-01 17:17:08 +01:00
|
|
|
add_to_solist (from_tty, dll_path, readsyms, &dll_desc, 0, target);
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* This hook gets called just before the first instruction in the
|
|
|
|
inferior process is executed.
|
|
|
|
|
|
|
|
This is our opportunity to set magic flags in the inferior so
|
|
|
|
that GDB can be notified when a shared library is mapped in and
|
|
|
|
to tell the dynamic linker that a private copy of the library is
|
|
|
|
needed (so GDB can set breakpoints in the library).
|
|
|
|
|
|
|
|
We need to set two flag bits in this routine.
|
|
|
|
|
|
|
|
DT_HP_DEBUG_PRIVATE to indicate that shared libraries should be
|
|
|
|
mapped private.
|
|
|
|
|
2005-01-14 02:01:34 +01:00
|
|
|
DT_HP_DEBUG_CALLBACK to indicate that we want the dynamic linker
|
|
|
|
to call the breakpoint routine for significant events. */
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_create_inferior_hook (void)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct minimal_symbol *msymbol;
|
|
|
|
unsigned int dld_flags, status;
|
|
|
|
asection *shlib_info, *interp_sect;
|
|
|
|
char buf[4];
|
|
|
|
struct objfile *objfile;
|
|
|
|
CORE_ADDR anaddr;
|
|
|
|
|
|
|
|
/* First, remove all the solib event breakpoints. Their addresses
|
|
|
|
may have changed since the last time we ran the program. */
|
|
|
|
remove_solib_event_breakpoints ();
|
|
|
|
|
|
|
|
if (symfile_objfile == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* First see if the objfile was dynamically linked. */
|
|
|
|
shlib_info = bfd_get_section_by_name (symfile_objfile->obfd, ".dynamic");
|
|
|
|
if (!shlib_info)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* It's got a .dynamic section, make sure it's not empty. */
|
|
|
|
if (bfd_section_size (symfile_objfile->obfd, shlib_info) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Read in the .dynamic section. */
|
|
|
|
if (! read_dynamic_info (shlib_info, &dld_cache))
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Unable to read the .dynamic section."));
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* Turn on the flags we care about. */
|
|
|
|
dld_cache.dld_flags |= DT_HP_DEBUG_PRIVATE;
|
|
|
|
dld_cache.dld_flags |= DT_HP_DEBUG_CALLBACK;
|
|
|
|
status = target_write_memory (dld_cache.dld_flags_addr,
|
|
|
|
(char *) &dld_cache.dld_flags,
|
|
|
|
sizeof (dld_cache.dld_flags));
|
|
|
|
if (status != 0)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Unable to modify dynamic linker flags."));
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* Now we have to create a shared library breakpoint in the dynamic
|
|
|
|
linker. This can be somewhat tricky since the symbol is inside
|
|
|
|
the dynamic linker (for which we do not have symbols or a base
|
|
|
|
load address! Luckily I wrote this code for solib.c years ago. */
|
|
|
|
interp_sect = bfd_get_section_by_name (exec_bfd, ".interp");
|
|
|
|
if (interp_sect)
|
|
|
|
{
|
|
|
|
unsigned int interp_sect_size;
|
|
|
|
char *buf;
|
|
|
|
CORE_ADDR load_addr;
|
|
|
|
bfd *tmp_bfd;
|
|
|
|
CORE_ADDR sym_addr = 0;
|
|
|
|
|
|
|
|
/* Read the contents of the .interp section into a local buffer;
|
|
|
|
the contents specify the dynamic linker this program uses. */
|
|
|
|
interp_sect_size = bfd_section_size (exec_bfd, interp_sect);
|
|
|
|
buf = alloca (interp_sect_size);
|
|
|
|
bfd_get_section_contents (exec_bfd, interp_sect,
|
|
|
|
buf, 0, interp_sect_size);
|
|
|
|
|
|
|
|
/* Now we need to figure out where the dynamic linker was
|
|
|
|
loaded so that we can load its symbols and place a breakpoint
|
|
|
|
in the dynamic linker itself.
|
|
|
|
|
|
|
|
This address is stored on the stack. However, I've been unable
|
|
|
|
to find any magic formula to find it for Solaris (appears to
|
|
|
|
be trivial on GNU/Linux). Therefore, we have to try an alternate
|
|
|
|
mechanism to find the dynamic linker's base address. */
|
|
|
|
tmp_bfd = bfd_openr (buf, gnutarget);
|
|
|
|
if (tmp_bfd == NULL)
|
|
|
|
goto get_out;
|
|
|
|
|
|
|
|
/* Make sure the dynamic linker's really a useful object. */
|
|
|
|
if (!bfd_check_format (tmp_bfd, bfd_object))
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
warning (_("Unable to grok dynamic linker %s as an object file"), buf);
|
1999-08-24 00:40:00 +02:00
|
|
|
bfd_close (tmp_bfd);
|
|
|
|
goto get_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We find the dynamic linker's base address by examining the
|
|
|
|
current pc (which point at the entry point for the dynamic
|
|
|
|
linker) and subtracting the offset of the entry point.
|
|
|
|
|
|
|
|
Also note the breakpoint is the second instruction in the
|
|
|
|
routine. */
|
|
|
|
load_addr = read_pc () - tmp_bfd->start_address;
|
|
|
|
sym_addr = bfd_lookup_symbol (tmp_bfd, "__dld_break");
|
|
|
|
sym_addr = load_addr + sym_addr + 4;
|
|
|
|
|
|
|
|
/* Create the shared library breakpoint. */
|
1999-09-22 05:28:34 +02:00
|
|
|
{
|
|
|
|
struct breakpoint *b
|
|
|
|
= create_solib_event_breakpoint (sym_addr);
|
|
|
|
|
|
|
|
/* The breakpoint is actually hard-coded into the dynamic linker,
|
|
|
|
so we don't need to actually insert a breakpoint instruction
|
|
|
|
there. In fact, the dynamic linker's code is immutable, even to
|
|
|
|
ttrace, so we shouldn't even try to do that. For cases like
|
|
|
|
this, we have "permanent" breakpoints. */
|
|
|
|
make_breakpoint_permanent (b);
|
|
|
|
}
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* We're done with the temporary bfd. */
|
|
|
|
bfd_close (tmp_bfd);
|
|
|
|
}
|
|
|
|
|
|
|
|
get_out:
|
|
|
|
/* Wipe out all knowledge of old shared libraries since their
|
|
|
|
mapping can change from one exec to another! */
|
|
|
|
while (so_list_head)
|
|
|
|
{
|
|
|
|
struct so_list *temp;
|
|
|
|
|
|
|
|
temp = so_list_head;
|
2000-12-15 02:01:51 +01:00
|
|
|
xfree (so_list_head);
|
1999-08-24 00:40:00 +02:00
|
|
|
so_list_head = temp->next;
|
|
|
|
}
|
|
|
|
clear_symtab_users ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This operation removes the "hook" between GDB and the dynamic linker,
|
|
|
|
which causes the dld to notify GDB of shared library events.
|
|
|
|
|
|
|
|
After this operation completes, the dld will no longer notify GDB of
|
|
|
|
shared library events. To resume notifications, GDB must call
|
|
|
|
pa64_solib_create_inferior_hook.
|
|
|
|
|
2005-01-14 02:01:34 +01:00
|
|
|
This operation does not remove any knowledge of shared libraries
|
|
|
|
of which GDB may already have been notified. */
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_remove_inferior_hook (int pid)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
/* Turn off the DT_HP_DEBUG_CALLBACK bit in the dynamic linker flags. */
|
|
|
|
dld_cache.dld_flags &= ~DT_HP_DEBUG_CALLBACK;
|
|
|
|
target_write_memory (dld_cache.dld_flags_addr,
|
|
|
|
(char *)&dld_cache.dld_flags,
|
|
|
|
sizeof (dld_cache.dld_flags));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function creates a breakpoint on the dynamic linker hook, which
|
|
|
|
is called when e.g., a shl_load or shl_unload call is made. This
|
|
|
|
breakpoint will only trigger when a shl_load call is made.
|
|
|
|
|
|
|
|
If filename is NULL, then loads of any dll will be caught. Else,
|
|
|
|
only loads of the file whose pathname is the string contained by
|
|
|
|
filename will be caught.
|
|
|
|
|
|
|
|
Undefined behaviour is guaranteed if this function is called before
|
|
|
|
pa64_solib_create_inferior_hook. */
|
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_create_catch_load_hook (int pid, int tempflag, char *filename,
|
|
|
|
char *cond_string)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
create_solib_load_event_breakpoint ("", tempflag, filename, cond_string);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function creates a breakpoint on the dynamic linker hook, which
|
|
|
|
is called when e.g., a shl_load or shl_unload call is made. This
|
|
|
|
breakpoint will only trigger when a shl_unload call is made.
|
|
|
|
|
|
|
|
If filename is NULL, then unloads of any dll will be caught. Else,
|
|
|
|
only unloads of the file whose pathname is the string contained by
|
|
|
|
filename will be caught.
|
|
|
|
|
|
|
|
Undefined behaviour is guaranteed if this function is called before
|
|
|
|
pa64_solib_create_inferior_hook. */
|
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_create_catch_unload_hook (int pid, int tempflag, char *filename,
|
|
|
|
char *cond_string)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
create_solib_unload_event_breakpoint ("", tempflag, filename, cond_string);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return nonzero if the dynamic linker has reproted that a library
|
|
|
|
has been loaded. */
|
|
|
|
|
|
|
|
int
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_have_load_event (int pid)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
CORE_ADDR event_kind;
|
|
|
|
|
2004-05-06 Randolph Chung <tausq@debian.org>
* config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM)
(HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM)
(PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM)
(EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM)
(RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM)
(CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM)
(ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM
definitions ...
* hppa-tdep.h: ... to here, with HPPA_ prefix.
* Makefile.in (hppah-nat.o): Add $(hppa_tdep_h)
* hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig)
(hppa64_hpux_frame_find_saved_regs_in_sig)
(child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage.
* hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise.
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum)
(hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache)
(hppa_linux_sigtramp_frame_prev_register): Likewise.
* hppa-tdep.c (hppa32_return_value, hppa64_return_value)
(hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align)
(hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache)
(hppa_frame_prev_register, hppa_stub_frame_unwind_cache)
(hppa_stub_frame_prev_register, hppa_unwind_dummy_id)
(hppa_skip_permanent_breakpoint, hppa_instruction_nullified)
(hppa32_register_type, hppa_cannot_store_register)
(hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise.
* hppah-nat.c (store_inferior_registers, fetch_register): Likewise.
* hpread.c (hpread_process_one_debug_symbol): Likewise.
* pa64solib.c (pa64_solib_have_load_event)
(pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname)
(pa64_solib_unloaded_library_pathname): Likewise.
* somsolib.c (som_solib_have_load_event, som_solib_have_unload_event)
(som_solib_library_pathname): Likewise.
2004-05-07 07:48:50 +02:00
|
|
|
event_kind = read_register (HPPA_ARG0_REGNUM);
|
1999-08-24 00:40:00 +02:00
|
|
|
return (event_kind == DLD_CB_LOAD);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return nonzero if the dynamic linker has reproted that a library
|
|
|
|
has been unloaded. */
|
|
|
|
int
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_have_unload_event (int pid)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
CORE_ADDR event_kind;
|
|
|
|
|
2004-05-06 Randolph Chung <tausq@debian.org>
* config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM)
(HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM)
(PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM)
(EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM)
(RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM)
(CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM)
(ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM
definitions ...
* hppa-tdep.h: ... to here, with HPPA_ prefix.
* Makefile.in (hppah-nat.o): Add $(hppa_tdep_h)
* hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig)
(hppa64_hpux_frame_find_saved_regs_in_sig)
(child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage.
* hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise.
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum)
(hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache)
(hppa_linux_sigtramp_frame_prev_register): Likewise.
* hppa-tdep.c (hppa32_return_value, hppa64_return_value)
(hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align)
(hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache)
(hppa_frame_prev_register, hppa_stub_frame_unwind_cache)
(hppa_stub_frame_prev_register, hppa_unwind_dummy_id)
(hppa_skip_permanent_breakpoint, hppa_instruction_nullified)
(hppa32_register_type, hppa_cannot_store_register)
(hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise.
* hppah-nat.c (store_inferior_registers, fetch_register): Likewise.
* hpread.c (hpread_process_one_debug_symbol): Likewise.
* pa64solib.c (pa64_solib_have_load_event)
(pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname)
(pa64_solib_unloaded_library_pathname): Likewise.
* somsolib.c (som_solib_have_load_event, som_solib_have_unload_event)
(som_solib_library_pathname): Likewise.
2004-05-07 07:48:50 +02:00
|
|
|
event_kind = read_register (HPPA_ARG0_REGNUM);
|
1999-08-24 00:40:00 +02:00
|
|
|
return (event_kind == DLD_CB_UNLOAD);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return a pointer to a string indicating the pathname of the most
|
|
|
|
recently loaded library.
|
|
|
|
|
|
|
|
The caller is reposible for copying the string before the inferior is
|
|
|
|
restarted. */
|
|
|
|
|
|
|
|
char *
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_loaded_library_pathname (int pid)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
static char dll_path[MAXPATHLEN];
|
2004-05-06 Randolph Chung <tausq@debian.org>
* config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM)
(HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM)
(PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM)
(EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM)
(RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM)
(CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM)
(ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM
definitions ...
* hppa-tdep.h: ... to here, with HPPA_ prefix.
* Makefile.in (hppah-nat.o): Add $(hppa_tdep_h)
* hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig)
(hppa64_hpux_frame_find_saved_regs_in_sig)
(child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage.
* hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise.
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum)
(hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache)
(hppa_linux_sigtramp_frame_prev_register): Likewise.
* hppa-tdep.c (hppa32_return_value, hppa64_return_value)
(hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align)
(hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache)
(hppa_frame_prev_register, hppa_stub_frame_unwind_cache)
(hppa_stub_frame_prev_register, hppa_unwind_dummy_id)
(hppa_skip_permanent_breakpoint, hppa_instruction_nullified)
(hppa32_register_type, hppa_cannot_store_register)
(hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise.
* hppah-nat.c (store_inferior_registers, fetch_register): Likewise.
* hpread.c (hpread_process_one_debug_symbol): Likewise.
* pa64solib.c (pa64_solib_have_load_event)
(pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname)
(pa64_solib_unloaded_library_pathname): Likewise.
* somsolib.c (som_solib_have_load_event, som_solib_have_unload_event)
(som_solib_library_pathname): Likewise.
2004-05-07 07:48:50 +02:00
|
|
|
CORE_ADDR dll_path_addr = read_register (HPPA_ARG3_REGNUM);
|
1999-08-24 00:40:00 +02:00
|
|
|
read_memory_string (dll_path_addr, dll_path, MAXPATHLEN);
|
|
|
|
return dll_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return a pointer to a string indicating the pathname of the most
|
|
|
|
recently unloaded library.
|
|
|
|
|
|
|
|
The caller is reposible for copying the string before the inferior is
|
|
|
|
restarted. */
|
|
|
|
|
|
|
|
char *
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_unloaded_library_pathname (int pid)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
static char dll_path[MAXPATHLEN];
|
2004-05-06 Randolph Chung <tausq@debian.org>
* config/pa/tm-hppa.h (RO_REGNUM, FLAGS_REGNUM, RP_REGNUM)
(HPPA_FP_REGNUM, HPPA_SP_REGNUM, SAR_REGNUM, IPSW_REGNUM)
(PCOQ_HEAD_REGNUM, PCSQ_HEAD_REGNUM, PCOQ_TAIL_REGNUM, PCSQ_TAIL_REGNUM)
(EIEM_REGNUM, IIR_REGNUM, ISR_REGNUM, IOR_REGNUM, SR4_REGNUM)
(RCR_REGNUM, PID0_REGNUM, PID1_REGNUM, PID2_REGNUM, PID3_REGNUM)
(CCR_REGNUM, TR0_REGNUM, CR27_REGNUM, HPPA_FP0_REGNUM, FP4_REGNUM)
(ARG0_REGNUM, ARG1_REGNUM, ARG2_REGNUM, ARG3_REGNUM): Move *_REGNUM
definitions ...
* hppa-tdep.h: ... to here, with HPPA_ prefix.
* Makefile.in (hppah-nat.o): Add $(hppa_tdep_h)
* hppa-hpux-tdep.c (hppa32_hpux_frame_find_saved_regs_in_sig)
(hppa64_hpux_frame_find_saved_regs_in_sig)
(child_get_current_exception_event): Add HPPA_ prefix to *_REGNUM usage.
* hppa-linux-nat.c (GR_REGNUM, TR_REGNUM, greg_map): Likewise.
* hppa-linux-tdep.c (hppa_dwarf_reg_to_regnum)
(hppa_linux_target_write_pc, hppa_linux_sigtramp_frame_unwind_cache)
(hppa_linux_sigtramp_frame_prev_register): Likewise.
* hppa-tdep.c (hppa32_return_value, hppa64_return_value)
(hppa32_push_dummy_call, hppa64_push_dummy_call, hppa64_frame_align)
(hppa_target_read_pc, hppa_target_write_pc, hppa_frame_cache)
(hppa_frame_prev_register, hppa_stub_frame_unwind_cache)
(hppa_stub_frame_prev_register, hppa_unwind_dummy_id)
(hppa_skip_permanent_breakpoint, hppa_instruction_nullified)
(hppa32_register_type, hppa_cannot_store_register)
(hppa_fetch_pointer_argument, hppa_pseudo_register_read): Likewise.
* hppah-nat.c (store_inferior_registers, fetch_register): Likewise.
* hpread.c (hpread_process_one_debug_symbol): Likewise.
* pa64solib.c (pa64_solib_have_load_event)
(pa64_solib_have_unload_event, pa64_solib_loaded_library_pathname)
(pa64_solib_unloaded_library_pathname): Likewise.
* somsolib.c (som_solib_have_load_event, som_solib_have_unload_event)
(som_solib_library_pathname): Likewise.
2004-05-07 07:48:50 +02:00
|
|
|
CORE_ADDR dll_path_addr = read_register (HPPA_ARG3_REGNUM);
|
1999-08-24 00:40:00 +02:00
|
|
|
read_memory_string (dll_path_addr, dll_path, MAXPATHLEN);
|
|
|
|
return dll_path;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return nonzero if PC is an address inside the dynamic linker. */
|
|
|
|
|
|
|
|
int
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_in_dynamic_linker (int pid, CORE_ADDR pc)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
asection *shlib_info;
|
|
|
|
|
|
|
|
if (symfile_objfile == NULL)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (!dld_cache.have_read_dld_descriptor)
|
2001-11-01 17:17:08 +01:00
|
|
|
if (!read_dld_descriptor (¤t_target, auto_solib_add))
|
1999-08-24 00:40:00 +02:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return (pc >= dld_cache.dld_desc.text_base
|
|
|
|
&& pc < dld_cache.dld_desc.text_base + dld_cache.dld_desc.text_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Return the GOT value for the shared library in which ADDR belongs. If
|
|
|
|
ADDR isn't in any known shared library, return zero. */
|
|
|
|
|
|
|
|
CORE_ADDR
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_get_got_by_pc (CORE_ADDR addr)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *so_list = so_list_head;
|
|
|
|
CORE_ADDR got_value = 0;
|
|
|
|
|
|
|
|
while (so_list)
|
|
|
|
{
|
|
|
|
if (so_list->pa64_solib_desc.text_base <= addr
|
|
|
|
&& ((so_list->pa64_solib_desc.text_base
|
|
|
|
+ so_list->pa64_solib_desc.text_size)
|
|
|
|
> addr))
|
|
|
|
{
|
|
|
|
got_value = so_list->pa64_solib_desc.linkage_ptr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
so_list = so_list->next;
|
|
|
|
}
|
|
|
|
return got_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the address of the handle of the shared library in which ADDR
|
|
|
|
belongs. If ADDR isn't in any known shared library, return zero.
|
|
|
|
|
|
|
|
This function is used in hppa_fix_call_dummy in hppa-tdep.c. */
|
|
|
|
|
|
|
|
CORE_ADDR
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_get_solib_by_pc (CORE_ADDR addr)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *so_list = so_list_head;
|
|
|
|
CORE_ADDR retval = 0;
|
|
|
|
|
|
|
|
while (so_list)
|
|
|
|
{
|
|
|
|
if (so_list->pa64_solib_desc.text_base <= addr
|
|
|
|
&& ((so_list->pa64_solib_desc.text_base
|
|
|
|
+ so_list->pa64_solib_desc.text_size)
|
|
|
|
> addr))
|
|
|
|
{
|
|
|
|
retval = so_list->pa64_solib_desc_addr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
so_list = so_list->next;
|
|
|
|
}
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Dump information about all the currently loaded shared libraries. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_sharedlibrary_info_command (char *ignore, int from_tty)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *so_list = so_list_head;
|
|
|
|
|
|
|
|
if (exec_bfd == NULL)
|
|
|
|
{
|
1999-11-17 03:31:06 +01:00
|
|
|
printf_unfiltered ("No executable file.\n");
|
1999-08-24 00:40:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (so_list == NULL)
|
|
|
|
{
|
|
|
|
printf_unfiltered ("No shared libraries loaded at this time.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
printf_unfiltered ("Shared Object Libraries\n");
|
1999-09-22 05:28:34 +02:00
|
|
|
printf_unfiltered (" %-19s%-19s%-19s%-19s\n",
|
|
|
|
" text start", " text end",
|
|
|
|
" data start", " data end");
|
1999-08-24 00:40:00 +02:00
|
|
|
while (so_list)
|
|
|
|
{
|
|
|
|
unsigned int flags;
|
|
|
|
|
|
|
|
printf_unfiltered ("%s", so_list->name);
|
|
|
|
if (so_list->objfile == NULL)
|
|
|
|
printf_unfiltered (" (symbols not loaded)");
|
|
|
|
if (so_list->loaded == 0)
|
|
|
|
printf_unfiltered (" (shared library unloaded)");
|
|
|
|
printf_unfiltered (" %-18s",
|
2004-09-11 12:24:53 +02:00
|
|
|
hex_string_custom (so_list->pa64_solib_desc.linkage_ptr, 16));
|
1999-08-24 00:40:00 +02:00
|
|
|
printf_unfiltered ("\n");
|
|
|
|
printf_unfiltered ("%-18s",
|
2004-09-11 12:24:53 +02:00
|
|
|
hex_string_custom (so_list->pa64_solib_desc.text_base, 16));
|
1999-08-24 00:40:00 +02:00
|
|
|
printf_unfiltered (" %-18s",
|
2004-09-11 12:24:53 +02:00
|
|
|
hex_string_custom ((so_list->pa64_solib_desc.text_base
|
|
|
|
+ so_list->pa64_solib_desc.text_size), 16));
|
1999-08-24 00:40:00 +02:00
|
|
|
printf_unfiltered (" %-18s",
|
2004-09-11 12:24:53 +02:00
|
|
|
hex_string_custom (so_list->pa64_solib_desc.data_base, 16));
|
1999-08-24 00:40:00 +02:00
|
|
|
printf_unfiltered (" %-18s\n",
|
2004-09-11 12:24:53 +02:00
|
|
|
hex_string_custom ((so_list->pa64_solib_desc.data_base
|
|
|
|
+ so_list->pa64_solib_desc.data_size), 16));
|
1999-08-24 00:40:00 +02:00
|
|
|
so_list = so_list->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Load up one or more shared libraries as directed by the user. */
|
|
|
|
|
|
|
|
static void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_sharedlibrary_command (char *args, int from_tty)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
dont_repeat ();
|
2001-11-01 17:17:08 +01:00
|
|
|
pa64_solib_add (args, from_tty, (struct target_ops *) 0, 1);
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the name of the shared library containing ADDR or NULL if ADDR
|
|
|
|
is not contained in any known shared library. */
|
|
|
|
|
|
|
|
char *
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_address (CORE_ADDR addr)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *so = so_list_head;
|
|
|
|
|
|
|
|
while (so)
|
|
|
|
{
|
|
|
|
/* Is this address within this shlib's text range? If so,
|
|
|
|
return the shlib's name. */
|
|
|
|
if (addr >= so->pa64_solib_desc.text_base
|
|
|
|
&& addr < (so->pa64_solib_desc.text_base
|
|
|
|
| so->pa64_solib_desc.text_size))
|
|
|
|
return so->name;
|
|
|
|
|
|
|
|
/* Nope, keep looking... */
|
|
|
|
so = so->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* No, we couldn't prove that the address is within a shlib. */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We are killing the inferior and restarting the program. */
|
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_solib_restart (void)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *sl = so_list_head;
|
|
|
|
|
|
|
|
/* Before the shlib info vanishes, use it to disable any breakpoints
|
|
|
|
that may still be active in those shlibs. */
|
|
|
|
disable_breakpoints_in_shlibs (0);
|
|
|
|
|
|
|
|
/* Discard all the shlib descriptors. */
|
|
|
|
while (sl)
|
|
|
|
{
|
|
|
|
struct so_list *next_sl = sl->next;
|
2000-12-15 02:01:51 +01:00
|
|
|
xfree (sl);
|
1999-08-24 00:40:00 +02:00
|
|
|
sl = next_sl;
|
|
|
|
}
|
|
|
|
so_list_head = NULL;
|
|
|
|
|
|
|
|
pa64_solib_total_st_size = (LONGEST) 0;
|
|
|
|
pa64_solib_st_size_threshold_exceeded = 0;
|
|
|
|
|
|
|
|
dld_cache.is_valid = 0;
|
|
|
|
dld_cache.have_read_dld_descriptor = 0;
|
|
|
|
dld_cache.dld_flags_addr = 0;
|
|
|
|
dld_cache.load_map = 0;
|
|
|
|
dld_cache.load_map_addr = 0;
|
|
|
|
dld_cache.dld_desc.data_base = 0;
|
|
|
|
dld_cache.dld_flags = 0;
|
|
|
|
dld_cache.dyninfo_sect = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-07-30 03:48:28 +02:00
|
|
|
_initialize_pa64_solib (void)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
add_com ("sharedlibrary", class_files, pa64_solib_sharedlibrary_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 16:49:28 +01:00
|
|
|
_("Load shared object library symbols for files matching REGEXP."));
|
1999-08-24 00:40:00 +02:00
|
|
|
add_info ("sharedlibrary", pa64_sharedlibrary_info_command,
|
2005-02-15 Andrew Cagney <cagney@gnu.org>
Mark up add_com, add_info and add_prefix_cmd.
* breakpoint.c, cp-support.c, dcache.c, dwarf2read.c: Update.
* exec.c, f-valprint.c, frame.c, gcore.c, gnu-nat.c: Update.
* go32-nat.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* kod.c, language.c, linux-nat.c, m32r-rom.c, macrocmd.c: Update.
* maint.c, memattr.c, mips-tdep.c, nto-procfs.c, objc-lang.c: Update.
* ocd.c, pa64solib.c, printcmd.c, procfs.c, regcache.c: Update.
* remote-e7000.c, remote-m32r-sdi.c, remote-mips.c: Update.
* remote-sds.c, remote-sim.c, remote-st.c, remote-utils.c: Update.
* remote.c, rs6000-tdep.c, ser-go32.c, serial.c: Update.
* sh-tdep.c, solib.c, somsolib.c, source.c, stack.c: Update.
* symfile.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, typeprint.c, utils.c, valprint.c: Update.
* win32-nat.c, xcoffsolib.c, cli/cli-cmds.c, cli/cli-dump.c: Update.
* cli/cli-logging.c, tui/tui-layout.c, tui/tui-regs.c: Update.
* tui/tui-stack.c, tui/tui-win.c: Update.
2005-02-15 16:49:28 +01:00
|
|
|
_("Status of loaded shared object libraries."));
|
2001-10-30 05:05:36 +01:00
|
|
|
|
2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_boolean_command through out. Delete #ifdef 0'ed
code adding set/show boolean commands.
* cp-valprint.c, dcache.c, exec.c, gdbtypes.c, infrun.c: Update.
* monitor.c, p-valprint.c, pa64solib.c, printcmd.c: Update.
* proc-api.c, remote-mips.c, remote.c, solib.c: Update.
* somsolib.c, symfile.c, top.c, utils.c, valops.c: Update.
* valprint.c, win32-nat.c, wince.c, xcoffsolib.c: Update.
* cli/cli-cmds.c: Update.
2005-02-18 16:25:32 +01:00
|
|
|
add_setshow_boolean_cmd ("auto-solib-add", class_support,
|
|
|
|
&auto_solib_add, _("\
|
|
|
|
Set autoloading of shared library symbols."), _("\
|
|
|
|
Show autoloading of shared library symbols."), _("\
|
2001-10-30 05:05:36 +01:00
|
|
|
If \"on\", symbols from all shared object libraries will be loaded\n\
|
|
|
|
automatically when the inferior begins execution, when the dynamic linker\n\
|
|
|
|
informs gdb that a new library has been loaded, or when attaching to the\n\
|
2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_boolean_command through out. Delete #ifdef 0'ed
code adding set/show boolean commands.
* cp-valprint.c, dcache.c, exec.c, gdbtypes.c, infrun.c: Update.
* monitor.c, p-valprint.c, pa64solib.c, printcmd.c: Update.
* proc-api.c, remote-mips.c, remote.c, solib.c: Update.
* somsolib.c, symfile.c, top.c, utils.c, valops.c: Update.
* valprint.c, win32-nat.c, wince.c, xcoffsolib.c: Update.
* cli/cli-cmds.c: Update.
2005-02-18 16:25:32 +01:00
|
|
|
inferior. Otherwise, symbols must be loaded manually, using `sharedlibrary'."),
|
|
|
|
NULL,
|
|
|
|
NULL, /* FIXME: i18n: */
|
|
|
|
&setlist, &showlist);
|
2001-10-30 05:05:36 +01:00
|
|
|
|
2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_zinteger_cmd through out. Re-sync gdbarch.sh
and gdbarch.c.
* breakpoint.c, frame.c, gdb-events.sh, gdbarch.sh: Update.
* gdbtypes.c, infrun.c, linux-nat.c, maint.c, monitor.c: Update.
* pa64solib.c, parse.c, remote-mips.c, ser-go32.c: Update.
* serial.c, solib-frv.c, somsolib.c, target.c, top.c: Update.
* varobj.c, cli/cli-cmds.c: Update.
* gdbarch.c, gdb-events.c: Regenerate.
2005-02-18 19:58:56 +01:00
|
|
|
add_setshow_zinteger_cmd ("auto-solib-limit", class_support,
|
|
|
|
&auto_solib_limit, _("\
|
|
|
|
Set threshold (in Mb) for autoloading shared library symbols."), _("\
|
|
|
|
Show threshold (in Mb) for autoloading shared library symbols."), _("\
|
2001-10-30 05:05:36 +01:00
|
|
|
When shared library autoloading is enabled, new libraries will be loaded\n\
|
|
|
|
only until the total size of shared library symbols exceeds this\n\
|
2005-02-18 Andrew Cagney <cagney@gnu.org>
Use add_setshow_zinteger_cmd through out. Re-sync gdbarch.sh
and gdbarch.c.
* breakpoint.c, frame.c, gdb-events.sh, gdbarch.sh: Update.
* gdbtypes.c, infrun.c, linux-nat.c, maint.c, monitor.c: Update.
* pa64solib.c, parse.c, remote-mips.c, ser-go32.c: Update.
* serial.c, solib-frv.c, somsolib.c, target.c, top.c: Update.
* varobj.c, cli/cli-cmds.c: Update.
* gdbarch.c, gdb-events.c: Regenerate.
2005-02-18 19:58:56 +01:00
|
|
|
threshold in megabytes. Is ignored when using `sharedlibrary'."),
|
|
|
|
NULL,
|
|
|
|
NULL, /* FIXME: i18n: */
|
|
|
|
&setlist, &showlist);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2001-10-30 05:05:36 +01:00
|
|
|
/* ??rehrauer: On HP-UX, the kernel parameter MAXDSIZ limits how
|
|
|
|
much data space a process can use. We ought to be reading
|
|
|
|
MAXDSIZ and setting auto_solib_limit to some large fraction of
|
|
|
|
that value. If not that, we maybe ought to be setting it smaller
|
|
|
|
than the default for MAXDSIZ (that being 64Mb, I believe).
|
|
|
|
However, [1] this threshold is only crudely approximated rather
|
|
|
|
than actually measured, and [2] 50 Mbytes is too small for
|
|
|
|
debugging gdb itself. Thus, the arbitrary 100 figure. */
|
|
|
|
auto_solib_limit = 100; /* Megabytes */
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
pa64_solib_restart ();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get some HPUX-specific data from a shared lib. */
|
|
|
|
CORE_ADDR
|
2004-11-13 03:24:34 +01:00
|
|
|
pa64_solib_thread_start_addr (struct so_list *so)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
return so->pa64_solib_desc.tls_start_addr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read the dynamic linker's internal shared library descriptor.
|
|
|
|
|
|
|
|
This must happen after dld starts running, so we can't do it in
|
|
|
|
read_dynamic_info. Record the fact that we have loaded the
|
|
|
|
descriptor. If the library is archive bound, then return zero, else
|
|
|
|
return nonzero. */
|
|
|
|
|
2002-12-04 18:53:26 +01:00
|
|
|
static int
|
2001-11-01 17:17:08 +01:00
|
|
|
read_dld_descriptor (struct target_ops *target, int readsyms)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
char *dll_path;
|
|
|
|
asection *dyninfo_sect;
|
|
|
|
|
|
|
|
/* If necessary call read_dynamic_info to extract the contents of the
|
|
|
|
.dynamic section from the shared library. */
|
|
|
|
if (!dld_cache.is_valid)
|
|
|
|
{
|
|
|
|
if (symfile_objfile == NULL)
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("No object file symbols."));
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
dyninfo_sect = bfd_get_section_by_name (symfile_objfile->obfd,
|
|
|
|
".dynamic");
|
|
|
|
if (!dyninfo_sect)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!read_dynamic_info (dyninfo_sect, &dld_cache))
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Unable to read in .dynamic section information."));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Read the load map pointer. */
|
|
|
|
if (target_read_memory (dld_cache.load_map_addr,
|
|
|
|
(char*) &dld_cache.load_map,
|
|
|
|
sizeof(dld_cache.load_map))
|
|
|
|
!= 0)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Error while reading in load map pointer."));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Read in the dld load module descriptor */
|
|
|
|
if (dlgetmodinfo (-1,
|
|
|
|
&dld_cache.dld_desc,
|
|
|
|
sizeof(dld_cache.dld_desc),
|
|
|
|
pa64_target_read_memory,
|
|
|
|
0,
|
|
|
|
dld_cache.load_map)
|
|
|
|
== 0)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Error trying to get information about dynamic linker."));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Indicate that we have loaded the dld descriptor. */
|
|
|
|
dld_cache.have_read_dld_descriptor = 1;
|
|
|
|
|
|
|
|
/* Add dld.sl to the list of known shared libraries so that we can
|
|
|
|
do unwind, etc.
|
|
|
|
|
|
|
|
?!? This may not be correct. Consider of dld.sl contains symbols
|
|
|
|
which are also referenced/defined by the user program or some user
|
|
|
|
shared library. We need to make absolutely sure that we do not
|
|
|
|
pollute the namespace from GDB's point of view. */
|
|
|
|
dll_path = dlgetname (&dld_cache.dld_desc,
|
|
|
|
sizeof(dld_cache.dld_desc),
|
|
|
|
pa64_target_read_memory,
|
|
|
|
0,
|
|
|
|
dld_cache.load_map);
|
2001-11-01 17:17:08 +01:00
|
|
|
add_to_solist(0, dll_path, readsyms, &dld_cache.dld_desc, 0, target);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read the .dynamic section and extract the information of interest,
|
|
|
|
which is stored in dld_cache. The routine elf_locate_base in solib.c
|
|
|
|
was used as a model for this. */
|
|
|
|
|
2002-12-04 18:53:26 +01:00
|
|
|
static int
|
2000-07-30 03:48:28 +02:00
|
|
|
read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
char *buf;
|
|
|
|
char *bufend;
|
|
|
|
CORE_ADDR dyninfo_addr;
|
|
|
|
int dyninfo_sect_size;
|
|
|
|
CORE_ADDR entry_addr;
|
|
|
|
|
|
|
|
/* Read in .dynamic section, silently ignore errors. */
|
|
|
|
dyninfo_addr = bfd_section_vma (symfile_objfile->obfd, dyninfo_sect);
|
|
|
|
dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect);
|
|
|
|
buf = alloca (dyninfo_sect_size);
|
|
|
|
if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Scan the .dynamic section and record the items of interest.
|
|
|
|
In particular, DT_HP_DLD_FLAGS */
|
|
|
|
for (bufend = buf + dyninfo_sect_size, entry_addr = dyninfo_addr;
|
|
|
|
buf < bufend;
|
|
|
|
buf += sizeof (Elf64_Dyn), entry_addr += sizeof (Elf64_Dyn))
|
|
|
|
{
|
|
|
|
Elf64_Dyn *x_dynp = (Elf64_Dyn*)buf;
|
|
|
|
Elf64_Sxword dyn_tag;
|
|
|
|
CORE_ADDR dyn_ptr;
|
2000-08-09 22:09:01 +02:00
|
|
|
char *pbuf;
|
1999-08-24 00:40:00 +02:00
|
|
|
|
2000-08-09 22:09:01 +02:00
|
|
|
pbuf = alloca (TARGET_PTR_BIT / HOST_CHAR_BIT);
|
1999-08-24 00:40:00 +02:00
|
|
|
dyn_tag = bfd_h_get_64 (symfile_objfile->obfd,
|
|
|
|
(bfd_byte*) &x_dynp->d_tag);
|
|
|
|
|
|
|
|
/* We can't use a switch here because dyn_tag is 64 bits and HP's
|
|
|
|
lame comiler does not handle 64bit items in switch statements. */
|
|
|
|
if (dyn_tag == DT_NULL)
|
|
|
|
break;
|
|
|
|
else if (dyn_tag == DT_HP_DLD_FLAGS)
|
|
|
|
{
|
|
|
|
/* Set dld_flags_addr and dld_flags in *dld_cache_p */
|
|
|
|
dld_cache_p->dld_flags_addr = entry_addr + offsetof(Elf64_Dyn, d_un);
|
|
|
|
if (target_read_memory (dld_cache_p->dld_flags_addr,
|
|
|
|
(char*) &dld_cache_p->dld_flags,
|
|
|
|
sizeof(dld_cache_p->dld_flags))
|
|
|
|
!= 0)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Error while reading in .dynamic section of the program."));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (dyn_tag == DT_HP_LOAD_MAP)
|
|
|
|
{
|
|
|
|
/* Dld will place the address of the load map at load_map_addr
|
|
|
|
after it starts running. */
|
|
|
|
if (target_read_memory (entry_addr + offsetof(Elf64_Dyn,
|
|
|
|
d_un.d_ptr),
|
|
|
|
(char*) &dld_cache_p->load_map_addr,
|
|
|
|
sizeof(dld_cache_p->load_map_addr))
|
|
|
|
!= 0)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Error while reading in .dynamic section of the program."));
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* tag is not of interest */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Record other information and set is_valid to 1. */
|
|
|
|
dld_cache_p->dyninfo_sect = dyninfo_sect;
|
|
|
|
|
|
|
|
/* Verify that we read in required info. These fields are re-set to zero
|
|
|
|
in pa64_solib_restart. */
|
|
|
|
|
|
|
|
if (dld_cache_p->dld_flags_addr != 0 && dld_cache_p->load_map_addr != 0)
|
|
|
|
dld_cache_p->is_valid = 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wrapper for target_read_memory to make dlgetmodinfo happy. */
|
|
|
|
|
|
|
|
static void *
|
2000-07-30 03:48:28 +02:00
|
|
|
pa64_target_read_memory (void *buffer, CORE_ADDR ptr, size_t bufsiz, int ident)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
if (target_read_memory (ptr, buffer, bufsiz) != 0)
|
|
|
|
return 0;
|
|
|
|
return buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Called from handle_dynlink_load_event and pa64_solib_add to add
|
|
|
|
a shared library to so_list_head list and possibly to read in the
|
|
|
|
debug information for the library.
|
|
|
|
|
|
|
|
If load_module_desc_p is NULL, then the load module descriptor must
|
|
|
|
be read from the inferior process at the address load_module_desc_addr. */
|
|
|
|
|
|
|
|
static void
|
2002-12-04 18:53:26 +01:00
|
|
|
add_to_solist (int from_tty, char *dll_path, int readsyms,
|
2000-07-30 03:48:28 +02:00
|
|
|
struct load_module_desc *load_module_desc_p,
|
|
|
|
CORE_ADDR load_module_desc_addr, struct target_ops *target)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
struct so_list *new_so, *so_list_tail;
|
|
|
|
int pa64_solib_st_size_threshhold_exceeded;
|
|
|
|
LONGEST st_size;
|
|
|
|
|
|
|
|
if (symfile_objfile == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
so_list_tail = so_list_head;
|
|
|
|
/* Find the end of the list of shared objects. */
|
|
|
|
while (so_list_tail && so_list_tail->next)
|
|
|
|
{
|
|
|
|
if (strcmp (so_list_tail->name, dll_path) == 0)
|
|
|
|
return;
|
|
|
|
so_list_tail = so_list_tail->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (so_list_tail && strcmp (so_list_tail->name, dll_path) == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* Add the shared library to the so_list_head list */
|
|
|
|
new_so = (struct so_list *) xmalloc (sizeof (struct so_list));
|
|
|
|
memset ((char *)new_so, 0, sizeof (struct so_list));
|
|
|
|
if (so_list_head == NULL)
|
|
|
|
{
|
|
|
|
so_list_head = new_so;
|
|
|
|
so_list_tail = new_so;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
so_list_tail->next = new_so;
|
|
|
|
so_list_tail = new_so;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize the new_so */
|
|
|
|
if (load_module_desc_p)
|
|
|
|
{
|
|
|
|
new_so->pa64_solib_desc = *load_module_desc_p;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (target_read_memory (load_module_desc_addr,
|
|
|
|
(char*) &new_so->pa64_solib_desc,
|
|
|
|
sizeof(struct load_module_desc))
|
|
|
|
!= 0)
|
|
|
|
{
|
2005-02-10 Andrew Cagney <cagney@gnu.org>
Mark up all error and warning messages.
* ada-lang.c, amd64-tdep.c, arch-utils.c, breakpoint.c: Update.
* bsd-kvm.c, bsd-uthread.c, coff-solib.h, coffread.c: Update.
* core-aout.c, core-regset.c, corefile.c, corelow.c: Update.
* cp-abi.c, cp-support.c, cp-valprint.c, cris-tdep.c: Update.
* dbxread.c, demangle.c, doublest.c, dsrec.c: Update.
* dve3900-rom.c, dwarf2expr.c, dwarf2loc.c: Update.
* dwarf2read.c, dwarfread.c, elfread.c, eval.c: Update.
* event-top.c, exec.c, expprint.c, f-lang.c: Update.
* f-typeprint.c, f-valprint.c, fbsd-nat.c, findvar.c: Update.
* frame.c, frv-linux-tdep.c, gcore.c, gdbtypes.c: Update.
* gnu-nat.c, gnu-v2-abi.c, gnu-v3-abi.c, go32-nat.c: Update.
* hpacc-abi.c, hppa-hpux-nat.c, hppa-hpux-tdep.c: Update.
* hppa-linux-nat.c, hppa-linux-tdep.c, hppa-tdep.c: Update.
* hpread.c, hpux-thread.c, i386-linux-nat.c: Update.
* i386-linux-tdep.c, i386-tdep.c, i386bsd-nat.c: Update.
* i386gnu-nat.c, i387-tdep.c, ia64-linux-nat.c: Update.
* ia64-tdep.c, inf-child.c, inf-ptrace.c, inf-ttrace.c: Update.
* infcall.c, infcmd.c, inflow.c, infptrace.c, infrun.c: Update.
* inftarg.c, interps.c, irix5-nat.c, jv-lang.c: Update.
* kod-cisco.c, kod.c, language.c, libunwind-frame.c: Update.
* linespec.c, linux-nat.c, linux-thread-db.c, m2-lang.c: Update.
* m32r-rom.c, m68hc11-tdep.c, m68k-tdep.c: Update.
* m68klinux-nat.c, macrocmd.c, macroexp.c, main.c: Update.
* maint.c, mdebugread.c, mem-break.c, memattr.c: Update.
* mips-linux-tdep.c, mips-tdep.c, mipsread.c, monitor.c: Update.
* nlmread.c, nto-procfs.c, objc-lang.c, objfiles.c: Update.
* observer.c, ocd.c, p-lang.c, p-typeprint.c: Update.
* p-valprint.c, pa64solib.c, parse.c, ppc-linux-tdep.c: Update.
* ppcnbsd-tdep.c, printcmd.c, procfs.c, remote-e7000.c: Update.
* remote-fileio.c, remote-m32r-sdi.c, remote-rdi.c: Update.
* remote-rdp.c, remote-sim.c, remote-st.c: Update.
* remote-utils.c, remote-utils.h, remote.c: Update.
* rom68k-rom.c, rs6000-nat.c, s390-tdep.c, scm-lang.c: Update.
* ser-e7kpc.c, ser-tcp.c, ser-unix.c, sh-tdep.c: Update.
* sh3-rom.c, shnbsd-tdep.c, sol-thread.c, solib-aix5.c: Update.
* solib-frv.c, solib-irix.c, solib-osf.c, solib-pa64.c: Update.
* solib-som.c, solib-sunos.c, solib-svr4.c, solib.c: Update.
* somread.c, somsolib.c, source.c, stabsread.c: Update.
* stack.c, std-regs.c, symfile-mem.c, symfile.c: Update.
* symmisc.c, symtab.c, target.c, thread.c, top.c: Update.
* tracepoint.c, trad-frame.c, typeprint.c, utils.c: Update.
* uw-thread.c, valarith.c, valops.c, valprint.c: Update.
* value.c, varobj.c, version.in, win32-nat.c, wince.c: Update.
* xcoffread.c, xcoffsolib.c, cli/cli-cmds.c: Update.
* cli/cli-decode.c, cli/cli-dump.c, cli/cli-logging.c: Update.
* cli/cli-script.c, cli/cli-setshow.c, mi/mi-cmd-break.c: Update.
* mi/mi-cmd-disas.c, mi/mi-cmd-env.c, mi/mi-cmd-file.c: Update.
* mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-getopt.c: Update.
* mi/mi-symbol-cmds.c, tui/tui-layout.c, tui/tui-stack.c: Update.
* tui/tui-win.c: Update.
2005-02-11 05:06:14 +01:00
|
|
|
error (_("Error while reading in dynamic library %s"), dll_path);
|
1999-08-24 00:40:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
new_so->pa64_solib_desc_addr = load_module_desc_addr;
|
|
|
|
new_so->loaded = 1;
|
|
|
|
new_so->name = obsavestring (dll_path, strlen(dll_path),
|
2004-02-07 Elena Zannoni <ezannoni@redhat.com>
* buildsym.c (free_pending_blocks, finish_block)
(record_pending_block, make_blockvector, end_symtab): Replace
symbol_obstack with objfile_obstack.
* coffread.c (process_coff_symbol, coff_read_struct_type)
(coff_read_enum_type): Ditto.
* cp-namespace.c (initialize_namespace_symtab)
(check_one_possible_namespace_symbol): Ditto.
* dwarf2read.c (new_symbol, dwarf2_const_value, macro_start_file)
(dwarf2_symbol_mark_computed): Ditto.
* dwarfread.c (enum_type, new_symbol, synthesize_typedef): Ditto.
* elfread.c (elf_symtab_read): Ditto.
* hpread.c (hpread_symfile_init, hpread_symfile_init)
(hpread_read_enum_type, hpread_read_function_type)
(hpread_read_doc_function_type, hpread_process_one_debug_symbol):
Ditto.
* jv-lang.c (get_java_class_symtab, add_class_symbol)
(java_link_class_type): Ditto.
* mdebugread.c (parse_symbol, psymtab_to_symtab_1, new_symtab)
(new_symbol): Ditto.
* minsyms.c (install_minimal_symbols): Ditto.
* objfiles.c (allocate_objfile): Remove init of symbol_obstack.
(terminate_minimal_symbol_table): Replace symbol_obstack with
objfile_obstack.
(free_objfile): Remove freeing of symbol_obstack.
* objfiles.h: Remove symbol_obstack field.
* pa64solib.c (add_to_solist): Replace symbol_obstack with
objfile_obstack.
* solib-sunos.c (allocate_rt_common_objfile): Remove init of
symbol_obstack.
(solib_add_common_symbols): Replace symbol_obstack with
objfile_obstack.
* somsolib.c (som_solib_add): Ditto.
* stabsread.c (patch_block_stabs, define_symbol, read_enum_type)
(common_block_start, common_block_end): Ditto.
* symfile.c (reread_symbols): Remove freeing and init of
symbol_obstack.
(allocate_symtab): Rename symbol_obstack to objfile_obstack.
* symfile.h: Update comment.
* symmisc.c (print_objfile_statistics): Remove symbol_obstack
stats printing.
* symtab.c (symbol_set_names): Replace symbol_obstack with
objfile_obstack.
* symtab.h (struct general_symbol_info, struct minimal_symbol):
Update comments.
* xcoffread.c (read_xcoff_symtab, SYMBOL_DUP, SYMNAME_ALLOC)
(init_stringtab, xcoff_initial_scan): Replace symbol_obstack with
objfile_obstack.
2004-02-08 00:13:47 +01:00
|
|
|
&symfile_objfile->objfile_obstack);
|
1999-08-24 00:40:00 +02:00
|
|
|
|
|
|
|
/* If we are not going to load the library, tell the user if we
|
|
|
|
haven't already and return. */
|
|
|
|
|
|
|
|
st_size = pa64_solib_sizeof_symbol_table (dll_path);
|
|
|
|
pa64_solib_st_size_threshhold_exceeded =
|
|
|
|
!from_tty
|
2001-11-01 17:17:08 +01:00
|
|
|
&& readsyms
|
1999-08-24 00:40:00 +02:00
|
|
|
&& ( (st_size + pa64_solib_total_st_size)
|
2001-10-30 18:34:30 +01:00
|
|
|
> (auto_solib_limit * (LONGEST) (1024 * 1024)));
|
1999-08-24 00:40:00 +02:00
|
|
|
if (pa64_solib_st_size_threshhold_exceeded)
|
|
|
|
{
|
|
|
|
pa64_solib_add_solib_objfile (new_so, dll_path, from_tty, 1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now read in debug info. */
|
|
|
|
pa64_solib_total_st_size += st_size;
|
|
|
|
|
|
|
|
/* This fills in new_so->objfile, among others. */
|
|
|
|
pa64_solib_load_symbols (new_so,
|
|
|
|
dll_path,
|
|
|
|
from_tty,
|
2000-11-20 18:44:07 +01:00
|
|
|
0,
|
|
|
|
target);
|
1999-08-24 00:40:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
LOCAL FUNCTION
|
|
|
|
|
|
|
|
bfd_lookup_symbol -- lookup the value for a specific symbol
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
|
|
|
|
CORE_ADDR bfd_lookup_symbol (bfd *abfd, char *symname)
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
|
|
|
An expensive way to lookup the value of a single symbol for
|
|
|
|
bfd's that are only temporary anyway. This is used by the
|
|
|
|
shared library support to find the address of the debugger
|
|
|
|
interface structures in the shared library.
|
|
|
|
|
|
|
|
Note that 0 is specifically allowed as an error return (no
|
|
|
|
such symbol).
|
|
|
|
*/
|
|
|
|
|
|
|
|
static CORE_ADDR
|
2000-07-30 03:48:28 +02:00
|
|
|
bfd_lookup_symbol (bfd *abfd, char *symname)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
unsigned int storage_needed;
|
|
|
|
asymbol *sym;
|
|
|
|
asymbol **symbol_table;
|
|
|
|
unsigned int number_of_symbols;
|
|
|
|
unsigned int i;
|
|
|
|
struct cleanup *back_to;
|
|
|
|
CORE_ADDR symaddr = 0;
|
|
|
|
|
|
|
|
storage_needed = bfd_get_symtab_upper_bound (abfd);
|
|
|
|
|
|
|
|
if (storage_needed > 0)
|
|
|
|
{
|
|
|
|
symbol_table = (asymbol **) xmalloc (storage_needed);
|
2002-06-08 22:02:51 +02:00
|
|
|
back_to = make_cleanup (xfree, symbol_table);
|
1999-08-24 00:40:00 +02:00
|
|
|
number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
|
|
|
|
|
|
|
|
for (i = 0; i < number_of_symbols; i++)
|
|
|
|
{
|
|
|
|
sym = *symbol_table++;
|
2002-06-08 22:02:51 +02:00
|
|
|
if (strcmp (sym->name, symname) == 0)
|
1999-08-24 00:40:00 +02:00
|
|
|
{
|
|
|
|
/* Bfd symbols are section relative. */
|
|
|
|
symaddr = sym->value + sym->section->vma;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
do_cleanups (back_to);
|
|
|
|
}
|
|
|
|
return (symaddr);
|
|
|
|
}
|
|
|
|
|