aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDavid Carlton <carlton@bactrian.org>2002-08-20 18:45:30 +0000
committerDavid Carlton <carlton@bactrian.org>2002-08-20 18:45:30 +0000
commit41ff2da14cddc1398262d459f40b3613354c6a52 (patch)
tree5dccea7c5755d2372b9ea2e9dd3efdb91794d8ec /gdb
parente5451d58f4028184281599ce99ce387c3705cad5 (diff)
downloadgdb-41ff2da14cddc1398262d459f40b3613354c6a52.zip
gdb-41ff2da14cddc1398262d459f40b3613354c6a52.tar.gz
gdb-41ff2da14cddc1398262d459f40b3613354c6a52.tar.bz2
2002-08-13 David Carlton <carlton@math.stanford.edu>
* dwarf2read.c (dwarf2_build_psymtabs): Check that dwarf_line_offset is nonzero before creating dwarf_line_buffer. (read_file_scope): Check that line_header is nonzero before decoding macro information.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/dwarf2read.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fedfe81..c72abc0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2002-08-20 David Carlton <carlton@math.stanford.edu>
+
+ * dwarf2read.c (dwarf2_build_psymtabs): Check that
+ dwarf_line_offset is nonzero before creating dwarf_line_buffer.
+ (read_file_scope): Check that line_header is nonzero before
+ decoding macro information.
+
2002-08-20 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.h (FP_REGNUM_P): Change such that we don't incorrectly
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 75ee279..0d96e1f 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1009,9 +1009,13 @@ dwarf2_build_psymtabs (struct objfile *objfile, int mainline)
dwarf_abbrev_buffer = dwarf2_read_section (objfile,
dwarf_abbrev_offset,
dwarf_abbrev_size);
- dwarf_line_buffer = dwarf2_read_section (objfile,
- dwarf_line_offset,
- dwarf_line_size);
+
+ if (dwarf_line_offset)
+ dwarf_line_buffer = dwarf2_read_section (objfile,
+ dwarf_line_offset,
+ dwarf_line_size);
+ else
+ dwarf_line_buffer = NULL;
if (dwarf_str_offset)
dwarf_str_buffer = dwarf2_read_section (objfile,
@@ -1808,7 +1812,7 @@ read_file_scope (struct die_info *die, struct objfile *objfile,
header, so we can only read it if we've read the header
successfully. */
attr = dwarf_attr (die, DW_AT_macro_info);
- if (attr)
+ if (attr && line_header)
{
unsigned int macro_offset = DW_UNSND (attr);
dwarf_decode_macros (line_header, macro_offset,