From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27022 invoked by alias); 29 Dec 2004 10:02:30 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 26879 invoked from network); 29 Dec 2004 10:02:14 -0000 Received: from unknown (HELO palrel10.hp.com) (156.153.255.245) by sourceware.org with SMTP; 29 Dec 2004 10:02:14 -0000 Received: from hplms2.hpl.hp.com (hplms2.hpl.hp.com [15.0.152.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by palrel10.hp.com (Postfix) with ESMTP id 18EF55F7B; Wed, 29 Dec 2004 02:02:14 -0800 (PST) Received: from napali.hpl.hp.com (napali.hpl.hp.com [15.4.89.123]) by hplms2.hpl.hp.com (8.13.1/8.13.1/HPL-PA Hub) with ESMTP id iBTA2Cdc029719; Wed, 29 Dec 2004 02:02:12 -0800 (PST) Received: from napali.hpl.hp.com (napali [127.0.0.1]) by napali.hpl.hp.com (8.13.1/8.13.1/Debian-18) with ESMTP id iBTA2Cu2026303; Wed, 29 Dec 2004 02:02:12 -0800 Received: (from davidm@localhost) by napali.hpl.hp.com (8.13.1/8.13.1/Submit) id iBTA283i026300; Wed, 29 Dec 2004 02:02:08 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16850.32928.186122.878675@napali.hpl.hp.com> Date: Wed, 29 Dec 2004 10:02:00 -0000 From: David Mosberger Reply-To: davidm@hpl.hp.com To: geoffk@geoffk.com Cc: binutils@sources.redhat.com, davidm@napali.hpl.hp.com Subject: curious check in dwarf2_gen_line_info() X-URL: http://www.hpl.hp.com/personal/David_Mosberger/ X-SW-Source: 2004-12/txt/msg00332.txt.bz2 [Resend with Geoff's email-address corrected; I hope...] In dwarf2dbg.c:dwarf2_gen_line_info(), one finds this curious code and comment: /* Don't emit sequences of line symbols for the same line when the symbols apply to assembler code. It is necessary to emit duplicate line symbols when a compiler asks for them, because GDB uses them to determine the end of the prologue. */ if (debug_type == DEBUG_DWARF2 && line == loc->line && filenum == loc->filenum) return; The "debug_type == DEBUG_DWARF2" checks has the effect that for compiler-generated files, the line info is replicated for each instruction, even when that info doesn't change at all. The change seems to have been introduced back in 2002: 2002-04-17 Geoffrey Keating * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line numbers, gdb relies on them to detect the start of the prologue. but there is no hint on which platform needed this workaround. I looked at gdb's symtab.c:skip_prologue_using_sal() and as near as I can tell, that doesn't rely on having duplicate line-info. To evaluate the size impact of the line-info duplication, I compiled a fairly large Linux kernel file (sched.c). For that file, the .debug_line size changed as follows: original gas: 0x3b93 (+46%) fixed gas: 0x28cd So the workaround bloats the .debug_line section by almost 50%. Is there a platform which really needs this workaround? If so, perhaps the workaround could be enabled for that platform only? Thanks, --david