aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1997-09-25 01:26:36 +0000
committerStu Grossman <grossman@cygnus>1997-09-25 01:26:36 +0000
commit45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa (patch)
treee34e5accd538bab88c44b9091ba8f6e8998d96cc /gdb/buildsym.c
parent4d5d36f015212384d5540c5d65ae9e220ad226cc (diff)
downloadgdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.zip
gdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.tar.gz
gdb-45a70ed6531bf1ecd9266991e8d1bb44c9e66bfa.tar.bz2
* The following block of changes add support for debugging assembly
source files. * breakpoint.c (resolve_sal_pc): Prevent crash when pc isn't associated with a function. * buildsym.c (record_line start_symtab end_symtab): Don't delete symtabs which only have line numbers (but no other debug symbols). * dbxread.c (read_dbx_symtab end_psymtab): Ditto. * remote-sim.c: New functions gdbsim_insert/remove_breakpoint. Use intrinsic simulator breakpoints if available, otherwise do it the hard way. * configure.tgt: Add d30v. * d30v-tdep.c: New file. * config/d30v/d30v.mt, config/d30v/tm-d30v.h: New files.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 806d700..f5b1683 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -55,6 +55,10 @@ static struct pending_block *pending_blocks = NULL;
static struct pending *free_pendings;
+/* Non-zero if symtab has line number info. This prevents an otherwise empty
+ symtab from being tossed. */
+
+static int have_line_numbers;
static int
compare_line_numbers PARAMS ((const void *, const void *));
@@ -714,6 +718,7 @@ record_line (subfile, line, pc)
xmalloc (sizeof (struct linetable)
+ subfile->line_vector_length * sizeof (struct linetable_entry));
subfile->line_vector->nitems = 0;
+ have_line_numbers = 1;
}
if (subfile->line_vector->nitems + 1 >= subfile->line_vector_length)
@@ -770,6 +775,7 @@ start_symtab (name, dirname, start_addr)
file_symbols = NULL;
global_symbols = NULL;
within_function = 0;
+ have_line_numbers = 0;
/* Context stack is initially empty. Allocate first one with room for
10 levels; reuse it forever afterward. */
@@ -886,7 +892,8 @@ end_symtab (end_addr, objfile, section)
if (pending_blocks == NULL
&& file_symbols == NULL
- && global_symbols == NULL)
+ && global_symbols == NULL
+ && have_line_numbers == 0)
{
/* Ignore symtabs that have no functions with real debugging info */
blockvector = NULL;