For gdb-4.17 : COFF and C++

Philippe De Muyter phdm@macqel.be
Mon Feb 9 21:38:00 GMT 1998


The following patch changes all FAIL's in gdb.c++/cplusfuncs.exp to PASS's.

Mon Feb  9 16:47:11 1998  Philippe De Muyter  <phdm@macqel.be>

	* coffread.c (coff_start_symtab): Function takes new parameter `name'
	and passes it to start_symtab.  All callers updated.
	(process_coff_symbol): Call SYMBOL_INIT_DEMANGLE_NAME.

--- ./gdb/coffread.c	Mon Feb  9 16:44:48 1998
+++ ./gdb/coffread.c	Mon Feb  9 13:01:56 1998
@@ -22,6 +22,7 @@
 #include "defs.h"
 #include "symtab.h"
 #include "gdbtypes.h"
+#include "demangle.h"
 #include "breakpoint.h"
 
 #include "bfd.h"
@@ -249,7 +250,7 @@
 
 static void complete_symtab PARAMS ((char *, CORE_ADDR, unsigned int));
 
-static void coff_start_symtab PARAMS ((void));
+static void coff_start_symtab PARAMS ((char *));
 
 static void coff_record_line PARAMS ((int, CORE_ADDR));
 
@@ -468,14 +469,15 @@ coff_record_line (line, pc)
    it indicates the start of data for one original source file.  */
 
 static void
-coff_start_symtab ()
+coff_start_symtab (name)
+    char *name;
 {
   start_symtab (
 		/* We fill in the filename later.  start_symtab puts
 		   this pointer into last_source_file and we put it in
 		   subfiles->name, which end_symtab frees; that's why
 		   it must be malloc'd.  */
-		savestring ("", 0),
+		savestring (name, strlen(name)),
 		/* We never know the directory name for COFF.  */
 		NULL,
 		/* The start address is irrelevant, since we set
@@ -544,7 +546,6 @@ coff_end_symtab (objfile)
      before (or because doing it now is simply an artifact of how this
      file used to be written).  */
   subfiles->line_vector = line_vector;
-  subfiles->name = last_source_file;
 
   symtab = end_symtab (current_source_end_addr, objfile, 0);
 
@@ -859,7 +860,7 @@ coff_symtab_read (symtab_offset, nsyms, 
     xmalloc (type_vector_length * sizeof (struct type *));
   memset (type_vector, 0, type_vector_length * sizeof (struct type *));
 
-  coff_start_symtab ();
+  coff_start_symtab ("");
 
   symnum = 0;
   while (symnum < nsyms)
@@ -873,7 +874,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 	  if (last_source_file)
 	    coff_end_symtab (objfile);
 
-	  coff_start_symtab ();
+	  coff_start_symtab ("_globals_");
 	  complete_symtab ("_globals_", 0, 0);
 	  /* done with all files, everything from here on out is globals */
 	}
@@ -924,7 +925,7 @@ coff_symtab_read (symtab_offset, nsyms, 
 	    if (last_source_file)
 	      {
 		coff_end_symtab (objfile);
-		coff_start_symtab ();
+		coff_start_symtab (filestring);
 	      }
 	    in_source_file = 1;
 	    break;
@@ -1532,6 +1533,8 @@ process_coff_symbol (cs, aux, section_of
   name = EXTERNAL_NAME (name, objfile->obfd);
   SYMBOL_NAME (sym) = obsavestring (name, strlen (name),
 				    &objfile->symbol_obstack);
+  SYMBOL_LANGUAGE (sym) = language_auto;
+  SYMBOL_INIT_DEMANGLED_NAME (sym, &objfile->symbol_obstack);
 
   /* default assumptions */
   SYMBOL_VALUE (sym) = cs->c_value;



More information about the Gdb mailing list