* objfiles.h, infcmd.c, symfile.c: Add comments about how various
authorJim Kingdon <jkingdon@engr.sgi.com>
Sun, 31 Oct 1993 15:46:34 +0000 (15:46 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Sun, 31 Oct 1993 15:46:34 +0000 (15:46 +0000)
objfiles get created and when we should blow them away.

gdb/ChangeLog
gdb/infcmd.c
gdb/objfiles.h
gdb/symfile.c

index 11a21e1327a17b1537e8f54ef995238341bfbc49..270b573be452650548da0c8c2b70179c6945165b 100644 (file)
@@ -1,3 +1,8 @@
+Sun Oct 31 09:28:46 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
+
+       * objfiles.h, infcmd.c, symfile.c: Add comments about how various
+       objfiles get created and when we should blow them away.
+
 Sat Oct 30 08:32:53 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
        * symfile.c (reread_symbols): When re-reading symbols, do all the
index cd74b20aa26eefe07da101f1edc5e8e7b673983c..28ecc1a301e17793ad8552ad271c43b1276605ac 100644 (file)
@@ -30,6 +30,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "gdbcmd.h"
 #include "gdbcore.h"
 #include "target.h"
+#include "language.h"
 
 static void
 continue_command PARAMS ((char *, int));
@@ -227,6 +228,14 @@ Start it from the beginning? "))
      we just have to worry about the symbol file.  */
   reread_symbols ();
 
+  /* We keep symbols from add-symbol-file, on the grounds that the
+     user might want to add some symbols before running the program
+     (right?).  But sometimes (dynamic loading where the user manually
+     introduces the new symbols with add-symbol-file), the code which
+     the symbols describe does not persist between runs.  Currently
+     the user has to manually nuke all symbols between runs if they
+     want them to go away (PR 2207).  This is probably reasonable.  */
+
   if (args)
     {
       char *cmd;
@@ -549,10 +558,21 @@ run_stack_dummy (addr, buffer)
     struct breakpoint *bpt;
     struct symtab_and_line sal;
 
+#if CALL_DUMMY_LOCATION != AT_ENTRY_POINT
     sal.pc = addr - CALL_DUMMY_START_OFFSET + CALL_DUMMY_BREAKPOINT_OFFSET;
+#else
+    sal.pc = entry_point_address ();
+#endif
     sal.symtab = NULL;
     sal.line = 0;
 
+    /* Set up a FRAME for the dummy frame so we can pass it to
+       set_momentary_breakpoint.  We need to give the breakpoint a
+       frame in case there is only one copy of the dummy (e.g.
+       CALL_DUMMY_LOCATION == AFTER_TEXT_END).  */
+    flush_cached_frames ();
+    set_current_frame (create_new_frame (read_fp (), sal.pc));
+
     /* If defined, CALL_DUMMY_BREAKPOINT_OFFSET is where we need to put
        a breakpoint instruction.  If not, the call dummy already has the
        breakpoint instruction in it.
@@ -560,7 +580,7 @@ run_stack_dummy (addr, buffer)
        addr is the address of the call dummy plus the CALL_DUMMY_START_OFFSET,
        so we need to subtract the CALL_DUMMY_START_OFFSET.  */
     bpt = set_momentary_breakpoint (sal,
-                                   NULL,
+                                   get_current_frame (),
                                    bp_call_dummy);
     bpt->disposition = delete;
 
index b5b06223728b3b432033e5078ff6e937922ca554..bf1a930ffdce4e299db3cb93093ed5bc5309842f 100644 (file)
@@ -149,10 +149,13 @@ struct obj_section {
   struct objfile *objfile;
 };
 
-/* Master structure for keeping track of each input file from which
-   gdb reads symbols.  One of these is allocated for each such file we
-   access, e.g. the exec_file, symbol_file, and any shared library object
-   files. */
+/* Master structure for keeping track of each file from which
+   gdb reads symbols.  There are several ways these get allocated: 1.
+   The main symbol file, symfile_objfile, set by the symbol-file command,
+   2.  Additional symbol files added by the add-symbol-file command,
+   3.  Shared library objfiles, added by ADD_SOLIB,  4.  symbol files
+   for modules that were loaded when GDB attached to a remote system
+   (see remote-vx.c).  */
 
 struct objfile
 {
index 5dbcbfa48748140a00683a783985307fb7d89ec4..8430ae9438c4b50582dcf73cfc4e29be4abeca5d 100644 (file)
@@ -376,6 +376,11 @@ syms_from_objfile (objfile, addr, mainline, verbo)
          symfile_objfile = NULL;
        }
 
+      /* Currently we keep symbols from the add-symbol-file command.
+        If the user wants to get rid of them, they should do "symbol-file"
+        without arguments first.  Not sure this is the best behavior
+        (PR 2207).  */
+
       (*objfile -> sf -> sym_new_init) (objfile);
     }
 
This page took 0.030633 seconds and 4 git commands to generate.