From 137a07e69da8cb956951fae6f84c3af96351a3b4 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Thu, 9 Feb 1995 20:21:46 +0000 Subject: [PATCH] * config/sparc/tm-sun4sol2.h: Define STATIC_TRANSFORM_NAME. * partial-stab.h: Call it. * stabsread.c (define_symbol) [STATIC_TRANSFORM_NAME]: Call STATIC_TRANSFORM_NAME to get the name and use minimal symbols to get the address. * sparc-tdep.c (solaris_static_transform_name): New function. --- gdb/ChangeLog | 9 +++++++++ gdb/config/sparc/tm-sun4sol2.h | 3 +++ gdb/partial-stab.h | 3 +++ gdb/stabsread.c | 24 ++++++++++++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dccc1f8f507..b7dbd7b11d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +Thu Feb 9 07:43:41 1995 Jim Kingdon + + * config/sparc/tm-sun4sol2.h: Define STATIC_TRANSFORM_NAME. + * partial-stab.h: Call it. + * stabsread.c (define_symbol) [STATIC_TRANSFORM_NAME]: Call + STATIC_TRANSFORM_NAME to get the name and use minimal symbols to + get the address. + * sparc-tdep.c (solaris_static_transform_name): New function. + Thu Feb 9 12:09:09 1995 Jeff Law (law@snake.cs.utah.edu) * somread.c (som_symtab_read): Handle dynamic relocation for both diff --git a/gdb/config/sparc/tm-sun4sol2.h b/gdb/config/sparc/tm-sun4sol2.h index 292e683b570..79f21e7c1ab 100644 --- a/gdb/config/sparc/tm-sun4sol2.h +++ b/gdb/config/sparc/tm-sun4sol2.h @@ -64,6 +64,9 @@ get_longjmp_target PARAMS ((CORE_ADDR *)); and for SunPRO 3.0, N_FUN symbols too. */ #define SOFUN_ADDRESS_MAYBE_MISSING +extern char *solaris_static_transform_name PARAMS ((char *)); +#define STATIC_TRANSFORM_NAME(x) solaris_static_transform_name (x) + #define FAULTED_USE_SIGINFO /* Enable handling of shared libraries for a.out executables. */ diff --git a/gdb/partial-stab.h b/gdb/partial-stab.h index e92da5a3b70..f1ab99138b8 100644 --- a/gdb/partial-stab.h +++ b/gdb/partial-stab.h @@ -378,6 +378,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ { case 'S': CUR_SYMBOL_VALUE += ANOFFSET (section_offsets, SECT_OFF_DATA); +#ifdef STATIC_TRANSFORM_NAME + namestring = STATIC_TRANSFORM_NAME (namestring); +#endif ADD_PSYMBOL_ADDR_TO_LIST (namestring, p - namestring, VAR_NAMESPACE, LOC_STATIC, objfile->static_psymbols, diff --git a/gdb/stabsread.c b/gdb/stabsread.c index ac334b278f8..3b7c8e1256f 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -1047,6 +1047,18 @@ define_symbol (valu, string, desc, type, objfile) SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = valu; +#ifdef STATIC_TRANSFORM_NAME + if (SYMBOL_NAME (sym)[0] == '$') + { + struct minimal_symbol *msym; + msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile); + if (msym != NULL) + { + SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)); + SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); + } + } +#endif SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; add_symbol_to_list (sym, &file_symbols); break; @@ -1173,6 +1185,18 @@ define_symbol (valu, string, desc, type, objfile) SYMBOL_TYPE (sym) = read_type (&p, objfile); SYMBOL_CLASS (sym) = LOC_STATIC; SYMBOL_VALUE_ADDRESS (sym) = valu; +#ifdef STATIC_TRANSFORM_NAME + if (SYMBOL_NAME (sym)[0] == '$') + { + struct minimal_symbol *msym; + msym = lookup_minimal_symbol (SYMBOL_NAME (sym), NULL, objfile); + if (msym != NULL) + { + SYMBOL_NAME (sym) = STATIC_TRANSFORM_NAME (SYMBOL_NAME (sym)); + SYMBOL_VALUE_ADDRESS (sym) = SYMBOL_VALUE_ADDRESS (msym); + } + } +#endif SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE; if (os9k_stabs) add_symbol_to_list (sym, &global_symbols); -- 2.30.2