From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7158 invoked by alias); 19 Jan 2004 00:05:03 -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 7150 invoked from network); 19 Jan 2004 00:05:02 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 19 Jan 2004 00:05:02 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 3047C1A440D; Sun, 18 Jan 2004 19:02:59 -0500 (EST) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16395.7859.103028.66452@localhost.redhat.com> Date: Mon, 19 Jan 2004 00:05:00 -0000 To: David Carlton Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] pc bounds checking and namespaces In-Reply-To: References: X-SW-Source: 2004-01/txt/msg00487.txt.bz2 David Carlton writes: > When calculating the pc bounds for a block in dwarf2read.c, we assume > that all functions contained in that block are immediate children of > the block. I was using a patched version of GCC where this doesn't > hold - the dies associated to definitions of functions in namespaces > are children of a DW_TAG_namespace die instead of the > DW_TAG_compile_unit die. I don't know where GCC 3.4 puts the > relevant dies, so this might not be an issue with GCC 3.4, but it > might be; it seems like fixing that assumption is a good idea in any > case. > > So this patch takes the code to calculate the lowpc/highpc out of > psymtab_to_symtab_1 and read_file_scope (where that functionality had > been duplicated), extracts it to a new function get_scope_pc_bounds, > and then modifies that new function to handle DW_TAG_namespace > appropriately. > > I tried to come up with a test case for this, but I wasn't > successful. :-( I can say that, before this patch, I used to see a lot > of "pc 0xNNNN in read in psymtab, but not in symtab" messages when > debugging, and now I don't. > > Tested on GCC 3.2 both with and without DW_TAG_namespace, > i686-pc-linux-gnu, DWARF-2; no regressions. OK to commit? > Again, a sanity check with 2.95 and -gdwarf-2 would be good. > - { > - /* Some compilers don't define a DW_AT_high_pc attribute for > - the compilation unit. If the DW_AT_high_pc is missing, > - synthesize it, by scanning the DIE's below the compilation unit. */ I'd rather keep this comment around, probably at the first call. Ok otherwise. elena