aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-10-27 22:26:02 +0000
committerJohn Gilmore <gnu@cygnus>1991-10-27 22:26:02 +0000
commit4137c5fc0d1b24d00ceec0981ea5d9da77477f0e (patch)
tree1d01de4d5f225bdcd8cc81ac88c4cc022a7c7ba2 /gdb/dbxread.c
parent9439f48f4c52cd82eca522aea847e0a330568235 (diff)
downloadgdb-4137c5fc0d1b24d00ceec0981ea5d9da77477f0e.zip
gdb-4137c5fc0d1b24d00ceec0981ea5d9da77477f0e.tar.gz
gdb-4137c5fc0d1b24d00ceec0981ea5d9da77477f0e.tar.bz2
* buildsym.c: Break out initial malloc sizes.
(record_line): Record directly in a subfile. Alloc on demand. (compare_line_numbers): Add from xcoffread.c. (end_symtab): New params say whether to sort pendings and linetable. Patch block stabs if defined. Shrink linetable before allocating the symtab. * buildsym.h: Delete line_vector* and prev_line_number. Add global_stabs and file_stabs for xcoffread. * dbxread.c (start_subfile): Move to buildsym. Change above calls. * symtab.h: LINETABLE(symtab) can now be null. Zap LINELIST. * symmisc.c, symtab.c: Cope with null LINETABLEs.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c69
1 files changed, 4 insertions, 65 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 822a2f4..c7741ab 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -327,67 +327,6 @@ explicit_lookup_type (real_filenum, index)
}
#endif
-/* Handle an N_SOL symbol, which indicates the start of
- code that came from an included (or otherwise merged-in)
- source file with a different name. */
-
-void
-start_subfile (name, dirname)
- char *name;
- char *dirname;
-{
- register struct subfile *subfile;
-
- /* Save the current subfile's line vector data. */
-
- if (current_subfile)
- {
- current_subfile->line_vector_index = line_vector_index;
- current_subfile->line_vector_length = line_vector_length;
- current_subfile->prev_line_number = prev_line_number;
- }
-
- /* See if this subfile is already known as a subfile of the
- current main source file. */
-
- for (subfile = subfiles; subfile; subfile = subfile->next)
- {
- if (!strcmp (subfile->name, name))
- {
- line_vector = subfile->line_vector;
- line_vector_index = subfile->line_vector_index;
- line_vector_length = subfile->line_vector_length;
- prev_line_number = subfile->prev_line_number;
- current_subfile = subfile;
- return;
- }
- }
-
- /* This subfile is not known. Add an entry for it. */
-
- line_vector_index = 0;
- line_vector_length = 1000;
- prev_line_number = -2; /* Force first line number to be explicit */
- line_vector = (struct linetable *)
- xmalloc (sizeof (struct linetable)
- + line_vector_length * sizeof (struct linetable_entry));
-
- /* Make an entry for this subfile in the list of all subfiles
- of the current main source file. */
-
- subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
- subfile->next = subfiles;
- subfile->name = obsavestring (name, strlen (name));
- if (dirname == NULL)
- subfile->dirname = NULL;
- else
- subfile->dirname = obsavestring (dirname, strlen (dirname));
-
- subfile->line_vector = line_vector;
- subfiles = subfile;
- current_subfile = subfile;
-}
-
/* Handle the N_BINCL and N_EINCL symbol types
that act like N_SOL for switching source files
(different subfiles, as we call them) within one object file,
@@ -1920,7 +1859,7 @@ process_symbol_pair (type1, desc1, value1, name1,
/* No need to check PCC_SOL_BROKEN, on the assumption that such
broken PCC's don't put out N_SO pairs. */
if (last_source_file)
- (void)end_symtab (value2);
+ (void)end_symtab (value2, 0, 0);
start_symtab (name2, name1, value2);
}
@@ -2083,7 +2022,7 @@ read_ofile_symtab (desc, stringtab, stringtab_size, sym_offset,
}
}
- return end_symtab (text_offset + text_size);
+ return end_symtab (text_offset + text_size, 0, 0);
}
int
@@ -2310,7 +2249,7 @@ process_one_symbol (type, desc, valu, name)
}
#endif
if (last_source_file)
- (void)end_symtab (valu);
+ (void)end_symtab (valu, 0, 0);
start_symtab (name, NULL, valu);
break;
@@ -2343,7 +2282,7 @@ process_one_symbol (type, desc, valu, name)
#ifndef SUN_FIXED_LBRAC_BUG
last_pc_address = valu; /* Save for SunOS bug circumcision */
#endif
- record_line (desc, valu);
+ record_line (current_subfile, desc, valu);
break;
case N_BCOMM: