From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18229 invoked by alias); 14 Aug 2002 23:47:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18095 invoked from network); 14 Aug 2002 23:47:28 -0000 Received: from unknown (HELO zenia.red-bean.com) (66.244.67.22) by sources.redhat.com with SMTP; 14 Aug 2002 23:47:28 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.11.6/8.11.6) id g7ENbSd09847; Wed, 14 Aug 2002 18:37:29 -0500 To: David Carlton , Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: dwarf2_build_psymtabs should check that .debug_line exists References: <15697.45810.578860.108712@jackfruit.Stanford.EDU> From: Jim Blandy Date: Wed, 14 Aug 2002 16:47:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00359.txt.bz2 This looks good to me. Andrew, I can't get a fresh copy of copyright.list; is David in there yet? David Carlton writes: > In article , Jim Blandy writes: > > > It looks to me like read_file_scope shouldn't call dwarf_decode_macros > > either when line_header is zero. Could you add that to your patch, > > and re-post it? > > Oh, right, good call. Here it is; no new regressions. > > David Carlton > carlton@math.stanford.edu > > 2002-08-13 David Carlton > > * 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. > > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.64 > diff -u -p -r1.64 dwarf2read.c > --- dwarf2read.c 31 Jul 2002 22:35:30 -0000 1.64 > +++ dwarf2read.c 13 Aug 2002 21:30:02 -0000 > @@ -1009,9 +1009,13 @@ dwarf2_build_psymtabs (struct objfile *o > 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, s > 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,