From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12463 invoked by alias); 14 Sep 2004 20:00:05 -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 12455 invoked from network); 14 Sep 2004 20:00:05 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 14 Sep 2004 20:00:05 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i8EK05Q4020800 for ; Tue, 14 Sep 2004 16:00:05 -0400 Received: from localhost.redhat.com (to-dhcp51.toronto.redhat.com [172.16.14.151]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i8EJxvr29615; Tue, 14 Sep 2004 16:00:04 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6A7C228D2; Tue, 14 Sep 2004 15:57:49 -0400 (EDT) Message-ID: <41474D3D.4070809@gnu.org> Date: Tue, 14 Sep 2004 20:00:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040831 MIME-Version: 1.0 To: David Lecomber , Jim Blandy , Michael Elizabeth Chastain Cc: patches Subject: Re: [PATCH/RFA] buildsym.c: extend parent block bounds if child block exceed limit References: <1091826690.3932.33.camel@localhost> In-Reply-To: <1091826690.3932.33.camel@localhost> Content-Type: multipart/mixed; boundary="------------080500050407040702010809" X-SW-Source: 2004-09/txt/msg00233.txt.bz2 This is a multi-part message in MIME format. --------------080500050407040702010809 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 426 David, Per an earlier discussion with myself and MichaelC (added to To:) its really important that we get testcases for this and the other fortran bugs in place. I'm kind of begging here :-) Once and only with the testcases in place do we have an assurance that the next change (by someone else entirely) won't regress this existing change. Jim, I suspect everyone has assumed that this was a symtab patch :-) Andrew --------------080500050407040702010809 Content-Type: message/rfc822; name="Attached Message" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Attached Message" Content-length: 6020 Return-Path: Delivered-To: cagney@localhost.redhat.com Received: from localhost (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 8D7282B9D for ; Fri, 6 Aug 2004 17:13:05 -0400 (EDT) Envelope-to: cagney@gnu.org Delivery-date: Fri, 06 Aug 2004 17:11:00 -0400 Received: from fencepost.gnu.org by localhost with IMAP (fetchmail-6.2.4) for cagney@localhost (single-drop); Fri, 06 Aug 2004 17:13:05 -0400 (EDT) Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1BtBzQ-0005OR-By for cagney@gnu.org; Fri, 06 Aug 2004 17:11:00 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BtBzD-00065q-T5 for cagney@gnu.org; Fri, 06 Aug 2004 17:10:48 -0400 Received: from [12.107.209.250] (helo=sourceware.org) by monty-python.gnu.org with smtp (Exim 4.34) id 1BtBzD-00065k-HG for cagney@gnu.org; Fri, 06 Aug 2004 17:10:47 -0400 Received: (qmail 8437 invoked by alias); 6 Aug 2004 21:10:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Delivered-To: mailing list gdb-patches@sources.redhat.com Received: (qmail 8419 invoked from network); 6 Aug 2004 21:10:44 -0000 Received: from unknown (HELO d9000.firstnet.net.uk) (212.103.224.244) by sourceware.org with SMTP; 6 Aug 2004 21:10:44 -0000 Received: (qmail 11605 invoked by uid 105); 6 Aug 2004 21:10:29 -0000 Received: from unknown (HELO localhost.localdomain) (212.103.239.121) by d9000.first with SMTP; 6 Aug 2004 21:10:29 -0000 Received: from localhost (castle.priv.wark.uk.streamline-computing.com [192.168.1.249]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i76LARXY013956 for ; Fri, 6 Aug 2004 22:10:28 +0100 Subject: [PATCH/RFA] buildsym.c: extend parent block bounds if child block exceed limit From: David Lecomber To: patches Content-Type: multipart/mixed; boundary="=-gEI60pkqZ/YpAsaIxn07" Message-Id: <1091826690.3932.33.camel@localhost> Mime-Version: 1.0 Date: Fri, 06 Aug 2004 22:11:30 +0100 X-Spam-Status: No, hits=0.3 required=5.0 tests=PATCH_CONTEXT_DIFF,RCVD_IN_ORBS version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) --=-gEI60pkqZ/YpAsaIxn07 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 1512 All, f90 compiled with nested subroutines using Intel's compiler is handled badly by GDB. Line numbers are not found by backtrace. Although GDB is capable of reading out all the dwarf2 line information inside this routine correctly, it can't look up an address to get a line number when inside a block. The cause is that the containing function's block does not contain the contained function's address. > (gdb) b nest.f90:14 > Breakpoint 1 at 0x8049e04: file nest.f90, line 14. > (gdb) r > Starting program: /home/david/a.out > [Thread debugging using libthread_db enabled] > [New Thread 1024 (LWP 27093)] > [Switching to Thread 1024 (LWP 27093)] > > Breakpoint 1, 0x08049e04 in nest_.second_ () > (gdb) bt > #0 0x08049e04 in nest_.second_ () > #1 0x08049dee in nest () at nest.f90:9 > #2 0x08049da8 in main () where nest.f90 is attached and line 14 is in the middle of nested function second. With the attached patch applied the result is: > (gdb) bt > #0 second () at nest.f90:14 > #1 0x08049dee in nest () at nest.f90:9 > #2 0x08049da8 in main () I'd like to propose the attached patch. Presently if a child block extends beyond the parent, the child is shrunk to the parent's bounds. This reverses that. I wouldn't like to guess the possible consequences of this change... 2004-08-06 David Lecomber * buildsym.c (finish_block): Extend parent block bounds when child block exceeds current known bounds. Can someone check this and approve/reject? d. --=-gEI60pkqZ/YpAsaIxn07 Content-Disposition: attachment; filename=nest.f90 Content-Type: text/plain; name=nest.f90; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 219 PROGRAM Nest INTEGER j INTEGER i DO i=1, 100 j = i END DO time = Second() CONTAINS REAL FUNCTION Second() Second = REAL(10) END FUNCTION Second END PROGRAM Nest --=-gEI60pkqZ/YpAsaIxn07 Content-Disposition: attachment; filename=block.patch Content-Type: text/x-patch; name=block.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 1056 Index: gdb/buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.39 diff -c -p -r1.39 buildsym.c *** gdb/buildsym.c 7 Feb 2004 23:13:46 -0000 1.39 --- gdb/buildsym.c 28 Jul 2004 13:02:52 -0000 *************** finish_block (struct symbol *symbol, str *** 421,429 **** paddr_nz (BLOCK_END (block))); } if (BLOCK_START (pblock->block) < BLOCK_START (block)) ! BLOCK_START (pblock->block) = BLOCK_START (block); if (BLOCK_END (pblock->block) > BLOCK_END (block)) ! BLOCK_END (pblock->block) = BLOCK_END (block); } #endif BLOCK_SUPERBLOCK (pblock->block) = block; --- 421,429 ---- paddr_nz (BLOCK_END (block))); } if (BLOCK_START (pblock->block) < BLOCK_START (block)) ! BLOCK_START (block) = BLOCK_START (pblock->block); if (BLOCK_END (pblock->block) > BLOCK_END (block)) ! BLOCK_END (block) = BLOCK_END (pblock->block); } #endif BLOCK_SUPERBLOCK (pblock->block) = block; --=-gEI60pkqZ/YpAsaIxn07-- --------------080500050407040702010809--