From 46d185d3d1919b707dc3bea1f243bcec2843bffd Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Sun, 28 Aug 1994 13:57:48 +0000 Subject: [PATCH] * symfile.c (symbol_file_add): Move reinit_frame_cache call to the callers of symbol_file_add. Gets rid of heuristic fence-post warnings on mips and alpha targets when the PC resides in a shared library which is not yet read in. * coff-solib.c (coff_solib_add), cxux-nat.c (add_shared_symbol_files), irix5-nat.c (solib_add), osfsolib.c (solib_add), remote-vx.c (vx_open), solib.c (solib_add): Add call to reinit_frame_cache after all shared libraries are read in. * remote-udi.c (udi_load), remote-vx.c (vx_load_command), symfile.c (symbol_file_command, add_symbol_file_command): Add call to reinit_frame_cache after symbol_file_add. --- gdb/ChangeLog | 16 +++++++++++++++- gdb/coff-solib.c | 5 +++++ gdb/cxux-nat.c | 4 ++++ gdb/irix5-nat.c | 11 ++++++++--- gdb/osfsolib.c | 13 +++++++++---- gdb/remote-udi.c | 5 +++++ gdb/remote-vx.c | 15 +++++++++++++-- 7 files changed, 59 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c3a130ca22..6911fc4485 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +Sat Aug 27 23:32:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * symfile.c (symbol_file_add): Move reinit_frame_cache call to + the callers of symbol_file_add. Gets rid of heuristic fence-post + warnings on mips and alpha targets when the PC resides in a shared + library which is not yet read in. + * coff-solib.c (coff_solib_add), cxux-nat.c (add_shared_symbol_files), + irix5-nat.c (solib_add), osfsolib.c (solib_add), + remote-vx.c (vx_open), solib.c (solib_add): + Add call to reinit_frame_cache after all shared libraries are read in. + * remote-udi.c (udi_load), remote-vx.c (vx_load_command), + symfile.c (symbol_file_command, add_symbol_file_command): + Add call to reinit_frame_cache after symbol_file_add. + Wed Aug 24 17:45:14 1994 J.T. Conklin (jtc@cygnus.com) * config/xm-nbsd.h: New file, support for all NetBSD ports. @@ -109,7 +123,7 @@ Fri Aug 19 14:55:45 1994 Stan Shebs (shebs@andros.cygnus.com) Fri Aug 19 13:35:01 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * c-typeprint.c (c_print_type): Assume demangled arguments - if a '(' is found in varstring, Looking for ')' at the end of + if a '(' is found in varstring, looking for ')' at the end of varstring did fail with demangled const member functions, which have a trailing `const'. * remote.c (get_offsets, putpkt): Change to `char' buffers, diff --git a/gdb/coff-solib.c b/gdb/coff-solib.c index 697fdac2d2..4b8ab00024 100644 --- a/gdb/coff-solib.c +++ b/gdb/coff-solib.c @@ -20,6 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "defs.h" +#include "frame.h" #include "bfd.h" #include "gdbcore.h" #include "symtab.h" @@ -97,6 +98,10 @@ coff_solib_add (arg_string, from_tty, target) libsize -= len * 4; lib += len * 4; } + + /* Getting new symbols may change our opinion about what is + frameless. */ + reinit_frame_cache (); } } diff --git a/gdb/cxux-nat.c b/gdb/cxux-nat.c index 6216ede6d7..b36abcef72 100644 --- a/gdb/cxux-nat.c +++ b/gdb/cxux-nat.c @@ -392,6 +392,10 @@ add_shared_symbol_files () the symbols the user actually gets. */ lm = lms.l_prev; } + + /* Getting new symbols may change our opinion about what is + frameless. */ + reinit_frame_cache (); } int target_is_m88110; diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 74004d41d4..2831b9c61b 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -607,6 +607,7 @@ solib_add (arg_string, from_tty, target) char *re_err; int count; int old; + int symbols_added = 0; if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL) { @@ -614,9 +615,7 @@ solib_add (arg_string, from_tty, target) } /* Add the shared library sections to the section table of the - specified target, if any. We have to do this before reading the - symbol files as symbol_file_add calls reinit_frame_cache and - creating a new frame might access memory in the shared library. */ + specified target, if any. */ if (target) { /* Count how many new section_table entries there are. */ @@ -683,9 +682,15 @@ solib_add (arg_string, from_tty, target) { so_last = so; so -> symbols_loaded = 1; + symbols_added = 1; } } } + + /* Getting new symbols may change our opinion about what is + frameless. */ + if (symbols_added) + reinit_frame_cache (); } /* diff --git a/gdb/osfsolib.c b/gdb/osfsolib.c index 054d5841bf..6232ea1b79 100644 --- a/gdb/osfsolib.c +++ b/gdb/osfsolib.c @@ -473,6 +473,7 @@ solib_add (arg_string, from_tty, target) char *re_err; int count; int old; + int symbols_added = 0; if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL) { @@ -481,9 +482,7 @@ solib_add (arg_string, from_tty, target) /* Add the shared library sections to the section table of the - specified target, if any. We have to do this before reading the - symbol files as symbol_file_add calls reinit_frame_cache and - creating a new frame might access memory in the shared library. */ + specified target, if any. */ if (target) { /* Count how many new section_table entries there are. */ @@ -551,9 +550,15 @@ solib_add (arg_string, from_tty, target) { so_last = so; so -> symbols_loaded = 1; + symbols_added = 1; } } } + + /* Getting new symbols may change our opinion about what is + frameless. */ + if (symbols_added) + reinit_frame_cache (); } /* @@ -752,7 +757,7 @@ solib_create_inferior_hook() } while (stop_signal != TARGET_SIGNAL_TRAP); - /* solib_add will call reinit_frame_cache via symbol_file_add. + /* solib_add will call reinit_frame_cache. But we are stopped in the runtime loader and we do not have symbols for the runtime loader. So heuristic_proc_start will be called and will put out an annoying warning. diff --git a/gdb/remote-udi.c b/gdb/remote-udi.c index 4cbcbabfc0..be79608cf9 100644 --- a/gdb/remote-udi.c +++ b/gdb/remote-udi.c @@ -32,6 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ MiniMON interface with UDI-p interface. */ #include "defs.h" +#include "frame.h" #include "inferior.h" #include "wait.h" #include "value.h" @@ -1293,6 +1294,10 @@ udi_load(args, from_tty) download (args, from_tty); symbol_file_add (strtok (args, " \t"), from_tty, 0, 0, 0, 0); + + /* Getting new symbols may change our opinion about what is + frameless. */ + reinit_frame_cache (); } /*************************************************** UDI_WRITE_INFERIOR_MEMORY diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index 15ca4aeb70..c8625f5908 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -642,6 +642,10 @@ vx_load_command (arg_string, from_tty) /* FIXME, for now we ignore data_addr and bss_addr. */ symbol_file_add (arg_string, from_tty, text_addr, 0, 0, 0); + + /* Getting new symbols may change our opinion about what is + frameless. */ + reinit_frame_cache (); } #ifdef FIXME /* Not ready for prime time */ @@ -1002,6 +1006,7 @@ vx_open (args, from_tty) struct ldfile *pLoadFile; int i; extern CLIENT *pClient; + int symbols_added = 0; if (!args) error_no_arg ("target machine name"); @@ -1077,13 +1082,19 @@ vx_open (args, from_tty) /* Botches, FIXME: (1) Searches the PATH, not the source path. (2) data and bss are assumed to be at the usual offsets from text. */ - catch_errors (add_symbol_stub, (char *)pLoadFile, (char *)0, - RETURN_MASK_ALL); + if (catch_errors (add_symbol_stub, (char *)pLoadFile, (char *)0, + RETURN_MASK_ALL)) + symbols_added = 1; #endif } printf_filtered ("Done.\n"); clnt_freeres (pClient, xdr_ldtabl, &loadTable); + + /* Getting new symbols may change our opinion about what is + frameless. */ + if (symbols_added) + reinit_frame_cache (); } /* Takes a task started up outside of gdb and ``attaches'' to it. -- 2.34.1