aboutsummaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1995-03-10 11:21:32 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1995-03-10 11:21:32 +0000
commita1a0d9748466c84c988529cf9fa192822151d272 (patch)
tree9671506adfce8e823e5fb97e0bb37cdb0119c934 /gdb/elfread.c
parent45d6f6230e92308144b8455db8a00b21145580e7 (diff)
downloadgdb-a1a0d9748466c84c988529cf9fa192822151d272.zip
gdb-a1a0d9748466c84c988529cf9fa192822151d272.tar.gz
gdb-a1a0d9748466c84c988529cf9fa192822151d272.tar.bz2
Fix problems with infinite recursion when printing a class
that contains a static instance of the class. * cp-valprint.c (dont_print_vb_obstack): Renamed from dont_print_obstack, made static. (dont_print_statmem_obstack): New obstack, controls printing of static member classes. (_initialize_cp_valprint): Initialize it. (cp_print_static_field): New function, handles printing of static members. (cp_print_value_fields): New parameter dont_print_statmem to handle recursive printing of static member classes, use cp_print_static_field to handle printing of static members. * c-valprint.c (cp_print_value_fields): Update prototype and call to include additional dont_print_statmem parameter. * c-valprint.c, f-valprint.c (dont_print_obstack): Remove unused extern declaration. * alpha-tdep.c, findvar.c, infptrace.c: Include <string.h>. * config/alpha/tm-alpha.h (FRAME_FIND_SAVED_REGS): Call alpha_find_saved_regs if fi->saved_regs is still NULL. * elfread.c (elf_symtab_read): Ensure that the filename field of a minsym is nonempty. Ignore solib trampoline symbols from the main symbol table, they might have a bogus value. * procfs.c (set_proc_siginfo), config/alpha/alpha-osf2.mh: Fix typos in comments.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index 326f93c..a4d4f72 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -219,7 +219,7 @@ LOCAL FUNCTION
SYNOPSIS
void elf_symtab_read (bfd *abfd, CORE_ADDR addr,
- struct objfile *objfile)
+ struct objfile *objfile, int dynamic)
DESCRIPTION
@@ -260,7 +260,7 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
asymbol *filesym = 0;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Name of filesym, as saved on the symbol_obstack. */
- char *filesymname;
+ char *filesymname = obsavestring ("", 0, &objfile->symbol_obstack);
#endif
struct dbx_symfile_info *dbx = (struct dbx_symfile_info *)
objfile->sym_stab_info;
@@ -304,9 +304,12 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
continue;
}
- if (sym -> section == &bfd_und_section
+ if (dynamic
+ && sym -> section == &bfd_und_section
&& (sym -> flags & BSF_FUNCTION))
{
+ struct minimal_symbol *msym;
+
/* Symbol is a reference to a function defined in
a shared library.
If its value is non zero then it is usually the address
@@ -314,17 +317,17 @@ elf_symtab_read (abfd, addr, objfile, dynamic)
relative to the base address.
If its value is zero then the dynamic linker has to resolve
the symbol. We are unable to find any meaningful address
- for this symbol in the executable file, so we skip it.
- Irix 5 has a zero value for all shared library functions
- in the main symbol table, but the dynamic symbol table
- provides the right values. */
+ for this symbol in the executable file, so we skip it. */
symaddr = sym -> value;
if (symaddr == 0)
continue;
symaddr += addr;
- record_minimal_symbol_and_info ((char *) sym -> name, symaddr,
- mst_solib_trampoline, NULL,
- objfile);
+ msym = record_minimal_symbol_and_info
+ ((char *) sym -> name, symaddr,
+ mst_solib_trampoline, NULL, objfile);
+#ifdef SOFUN_ADDRESS_MAYBE_MISSING
+ msym->filename = filesymname;
+#endif
continue;
}