From: Eberhard Mattes <mattes@azu.informatik.uni-stuttgart.de>
[deliverable/binutils-gdb.git] / gdb / coff-solib.c
index a4bf6c4ebf770110b160e9cd5e65b80edb85a04a..c0cfcf5d7bdae9adcc83288575bd152fb0be98d3 100644 (file)
@@ -15,11 +15,12 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 
 #include "defs.h"
 
+#include "frame.h"
 #include "bfd.h"
 #include "gdbcore.h"
 #include "symtab.h"
@@ -62,13 +63,12 @@ coff_solib_add (arg_string, from_tty, target)
       struct libent
        {
          bfd_byte len[4];
-         bfd_byte unk[4];
-         char filename[1];
+         bfd_byte nameoffset[4];
        };
 
       libsize = bfd_section_size (exec_bfd, libsect);
 
-      lib = alloca (libsize);
+      lib = (unsigned char *) alloca (libsize);
 
       bfd_get_section_contents (exec_bfd, libsect, lib, 0, libsize);
 
@@ -76,16 +76,21 @@ coff_solib_add (arg_string, from_tty, target)
        {
          struct libent *ent;
          struct objfile *objfile;
-         int len;
+         int len, nameoffset;
+         char *filename;
 
          ent = (struct libent *)lib;
 
          len = bfd_get_32 (exec_bfd, ent->len);
 
+         nameoffset = bfd_get_32 (exec_bfd, ent->nameoffset);
+
          if (len <= 0)
            break;
 
-         objfile = symbol_file_add (ent->filename, from_tty,
+         filename = (char *)ent + nameoffset * 4;
+
+         objfile = symbol_file_add (filename, from_tty,
                                     0, /* addr */
                                     0, /* not mainline */
                                     0, /* not mapped */
@@ -93,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 ();
     }
 }
 
This page took 0.025381 seconds and 4 git commands to generate.