+Tue Mar 15 13:39:23 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ For Sunos 4.x targets, enable gdb to set breakpoints in shared
+ library functions before the executable is run. Retrieve dynamic
+ symbols from stripped executables.
+ * symtab.h (minimal_symbol_type): Add mst_solib_trampoline type.
+ * parse.c (write_exp_msymbol), symmisc.c (dump_msymbols),
+ symtab.c (list_symbols): Handle mst_solib_trampoline.
+ * minsyms.c (lookup_minimal_symbol): Handle mst_solib_trampoline
+ for all targets, remove IBM6000_TARGET dependencies.
+ * dbxread.c (read_dbx_dynamic_symtab): New function.
+ * dbxread.c (dbx_symfile_read): Use it.
+ * dbxread.c (SET_NAMESTRING): Set namestring to
+ "<bad string table index>" instead of "foo" if the string index is
+ corrupt.
+ * xcoffread.c (read_xcoff_symtab): Use mst_solib_trampoline instead
+ of mst_unknown.
+ * symtab.c (list_symbols): Take from_tty as parameter and pass it
+ to break_command. Handle mst_file_* minimal symbol types.
+ * config/i386/tm-i386bsd.h: Give just macro name, not args, to #undef.
+
Tue Mar 15 11:40:43 1994 Kung Hsu (kung@mexican.cygnus.com)
* c-exp.y(yylex): fix potential memory overflow.
struct minimal_symbol *msymbol;
struct minimal_symbol *found_symbol = NULL;
struct minimal_symbol *found_file_symbol = NULL;
-#ifdef IBM6000_TARGET
struct minimal_symbol *trampoline_symbol = NULL;
-#endif
for (objfile = object_files;
objfile != NULL && found_symbol == NULL;
found_file_symbol = msymbol;
break;
- case mst_unknown:
-#ifdef IBM6000_TARGET
- /* I *think* all platforms using shared
- libraries (and trampoline code) will suffer
- this problem. Consider a case where there are
- 5 shared libraries, each referencing `foo'
- with a trampoline entry. When someone wants
- to put a breakpoint on `foo' and the only
- info we have is minimal symbol vector, we
- want to use the real `foo', rather than one
- of those trampoline entries. MGO */
+ case mst_solib_trampoline:
/* If a trampoline symbol is found, we prefer to
keep looking for the *real* symbol. If the
- actual symbol not found, then we'll use the
- trampoline entry. Sorry for the machine
- dependent code here, but I hope this will
- benefit other platforms as well. For
- trampoline entries, we used mst_unknown
- earlier. Perhaps we should define a
- `mst_trampoline' type?? */
-
+ actual symbol is not found, then we'll use the
+ trampoline entry. */
if (trampoline_symbol == NULL)
trampoline_symbol = msymbol;
break;
-#else
- /* FALLTHROUGH */
-#endif
+
+ case mst_unknown:
default:
found_symbol = msymbol;
break;
if (found_file_symbol)
return found_file_symbol;
- /* Symbols for IBM shared library trampolines are next best. */
-#ifdef IBM6000_TARGET
+ /* Symbols for shared library trampolines are next best. */
if (trampoline_symbol)
return trampoline_symbol;
-#endif
return NULL;
}
{
case mst_text:
case mst_file_text:
+ case mst_solib_trampoline:
write_exp_elt_type (text_symbol_type);
break;
sources_info PARAMS ((char *, int));
static void
-list_symbols PARAMS ((char *, int, int));
+list_symbols PARAMS ((char *, int, int, int));
static void
output_source_filename PARAMS ((char *, int *));
we find. */
static void
-list_symbols (regexp, class, bpt)
+list_symbols (regexp, class, bpt, from_tty)
char *regexp;
int class;
int bpt;
+ int from_tty;
{
register struct symtab *s;
register struct partial_symtab *ps;
static enum minimal_symbol_type types[]
= {mst_data, mst_text, mst_abs, mst_unknown};
static enum minimal_symbol_type types2[]
- = {mst_bss, mst_text, mst_abs, mst_unknown};
+ = {mst_bss, mst_file_text, mst_abs, mst_unknown};
+ static enum minimal_symbol_type types3[]
+ = {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown};
+ static enum minimal_symbol_type types4[]
+ = {mst_file_bss, mst_text, mst_abs, mst_unknown};
enum minimal_symbol_type ourtype = types[class];
enum minimal_symbol_type ourtype2 = types2[class];
+ enum minimal_symbol_type ourtype3 = types3[class];
+ enum minimal_symbol_type ourtype4 = types4[class];
if (regexp != NULL)
{
ALL_MSYMBOLS (objfile, msymbol)
{
if (MSYMBOL_TYPE (msymbol) == ourtype ||
- MSYMBOL_TYPE (msymbol) == ourtype2)
+ MSYMBOL_TYPE (msymbol) == ourtype2 ||
+ MSYMBOL_TYPE (msymbol) == ourtype3 ||
+ MSYMBOL_TYPE (msymbol) == ourtype4)
{
if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
{
strcpy (string, s->filename);
strcat (string, ":");
strcat (string, SYMBOL_NAME(sym));
- break_command (string, 0);
+ break_command (string, from_tty);
}
}
else if (!found_in_file)
ALL_MSYMBOLS (objfile, msymbol)
{
if (MSYMBOL_TYPE (msymbol) == ourtype ||
- MSYMBOL_TYPE (msymbol) == ourtype2)
+ MSYMBOL_TYPE (msymbol) == ourtype2 ||
+ MSYMBOL_TYPE (msymbol) == ourtype3 ||
+ MSYMBOL_TYPE (msymbol) == ourtype4)
{
if (regexp == NULL || SYMBOL_MATCHES_REGEXP (msymbol))
{
char *regexp;
int from_tty;
{
- list_symbols (regexp, 0, 0);
+ list_symbols (regexp, 0, 0, from_tty);
}
static void
char *regexp;
int from_tty;
{
- list_symbols (regexp, 1, 0);
+ list_symbols (regexp, 1, 0, from_tty);
}
static void
char *regexp;
int from_tty;
{
- list_symbols (regexp, 2, 0);
+ list_symbols (regexp, 2, 0, from_tty);
}
#if 0
methods_info (regexp)
char *regexp;
{
- list_symbols (regexp, 3, 0);
+ list_symbols (regexp, 3, 0, from_tty);
}
#endif /* 0 */
char *regexp;
int from_tty;
{
- list_symbols (regexp, 1, 1);
+ list_symbols (regexp, 1, 1, from_tty);
}
\f
/* shared library function trampoline code entry point. */
else if (CSECT_SCLAS (&main_aux) == XMC_GL) {
- /* record trampoline code entries as mst_unknown symbol. When we
- lookup mst symbols, we will choose mst_text over mst_unknown. */
+ /* record trampoline code entries as mst_solib_trampoline symbol.
+ When we lookup mst symbols, we will choose mst_text over
+ mst_solib_trampoline. */
#if 1
/* After the implementation of incremental loading of shared
consistient with gdb's behaviour on a SUN platform. */
/* Trying to prefer *real* function entry over its trampoline,
- by assigning `mst_unknown' type to trampoline entries fails.
- Gdb treats those entries as chars. FIXME. */
+ by assigning `mst_solib_trampoline' type to trampoline entries
+ fails. Gdb treats those entries as chars. FIXME. */
/* Recording this entry is necessary. Single stepping relies on
this vector to get an idea about function address boundaries. */
prim_record_minimal_symbol_and_info
- ("<trampoline>", cs->c_value, mst_unknown,
+ ("<trampoline>", cs->c_value, mst_solib_trampoline,
(char *)NULL, cs->c_secnum, objfile);
#else
- /* record trampoline code entries as mst_unknown symbol. When we
- lookup mst symbols, we will choose mst_text over mst_unknown. */
+ /* record trampoline code entries as mst_solib_trampoline symbol.
+ When we lookup mst symbols, we will choose mst_text over
+ mst_solib_trampoline. */
- RECORD_MINIMAL_SYMBOL (cs->c_name, cs->c_value, mst_unknown,
+ RECORD_MINIMAL_SYMBOL (cs->c_name, cs->c_value,
+ mst_solib_trampoline,
symname_alloced, objfile);
#endif
continue;