From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13053 invoked by alias); 16 Mar 2011 17:32:31 -0000 Received: (qmail 13044 invoked by uid 22791); 16 Mar 2011 17:32:29 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Mar 2011 17:32:24 +0000 Received: from hpaq5.eem.corp.google.com (hpaq5.eem.corp.google.com [172.25.149.5]) by smtp-out.google.com with ESMTP id p2GHWMnh012125 for ; Wed, 16 Mar 2011 10:32:22 -0700 Received: from vxc34 (vxc34.prod.google.com [10.241.33.162]) by hpaq5.eem.corp.google.com with ESMTP id p2GHVpRF026295 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 16 Mar 2011 10:32:21 -0700 Received: by vxc34 with SMTP id 34so2130872vxc.41 for ; Wed, 16 Mar 2011 10:32:20 -0700 (PDT) Received: by 10.220.53.14 with SMTP id k14mr66176vcg.163.1300296740211; Wed, 16 Mar 2011 10:32:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.60.9 with HTTP; Wed, 16 Mar 2011 10:31:50 -0700 (PDT) In-Reply-To: <20110316060658.GA10163@host1.jankratochvil.net> References: <20110315004140.GA28560@host1.jankratochvil.net> <20110315183650.GA29330@host1.jankratochvil.net> <20110315190304.GA784@host1.jankratochvil.net> <20110315212428.GA21487@host1.jankratochvil.net> <20110316060658.GA10163@host1.jankratochvil.net> From: Paul Pluzhnikov Date: Wed, 16 Mar 2011 17:43:00 -0000 Message-ID: Subject: Re: [patch] Re: Advice on fixing gdb/12528 To: Jan Kratochvil Cc: Tom Tromey , gdb-patches ml , Doug Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00862.txt.bz2 On Tue, Mar 15, 2011 at 11:06 PM, Jan Kratochvil wrote: >> Maybe like this: >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (address =3D=3D 0 && !dwarf2_per_objf= ile->has_section_at_zero) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* This line table is for a func= tion which has been >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GCd by the linker. =A0Ign= ore it. =A0PR gdb/12528 */ >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 long line_offset >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D line_ptr - bytes_read - = dwarf2_per_objfile->line.buffer; >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 complaint (&symfile_complaints, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_(".debug= _line offset 0x%lx uses address 0 " >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"[in = module %s]"), >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0line_offs= et, cu->objfile->name); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 p_record_line =3D noop_record_li= ne; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > > BYTES_READ is here just for the ADDRESS size. Right. So the offset printed above is the offset of the address itself. > I do not think the displayed offset is so importatnt but at least the mod= ule > gets shown. I think it's still (slightly) better to print offset to the start of addres= s, rather than just after it. How about this then: if (address =3D=3D 0 && !dwarf2_per_objfile->has_section_at_zero) { /* This line table is for a function which has been GCd by the linker. Ignore it. PR gdb/12528 */ long line_offset =3D line_ptr - bytes_read - dwarf2_per_objfile->line.buffer; complaint (&symfile_complaints, _(".debug_line address at offset 0x%lx is 0 " "[in module %s]"), line_offset, cu->objfile->name); p_record_line =3D noop_record_line; } Thanks, --=20 Paul Pluzhnikov