From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9965 invoked by alias); 19 Apr 2010 18:08:26 -0000 Received: (qmail 9949 invoked by uid 22791); 19 Apr 2010 18:08:25 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Apr 2010 18:08:14 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3JI8CkR029401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Apr 2010 14:08:13 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3JI8ArC021315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 19 Apr 2010 14:08:12 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o3JI8AJi010602; Mon, 19 Apr 2010 20:08:10 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o3JI89ID010601; Mon, 19 Apr 2010 20:08:09 +0200 Date: Mon, 19 Apr 2010 18:08:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: add DWARF-4 features Message-ID: <20100419180809.GA4722@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-04/txt/msg00567.txt.bz2 On Tue, 13 Apr 2010 22:28:16 +0200, Tom Tromey wrote: > + case DW_FORM_sec_offset: > + DW_ADDR (attr) = read_offset (abfd, info_ptr, &cu->header, &bytes_read); > + info_ptr += bytes_read; > + break; should be DW_UNSND, already used such in your: > + case DW_FORM_sec_offset: > + fprintf_unfiltered (f, "section offset: %s", > + pulongest (DW_UNSND (&die->attrs[i]))); > + break; and the only consumer of this value in FSF GDB code is: dwarf2_symbol_mark_computed baton->size = dwarf2_per_objfile->loc.size - DW_UNSND (attr); baton->data = dwarf2_per_objfile->loc.buffer + DW_UNSND (attr); > @@ -8041,12 +8070,17 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, > { > /* Special operand. */ > adj_opcode = op_code - lh->opcode_base; > - address += (adj_opcode / lh->line_range) > - * lh->minimum_instruction_length; > + address += ((op_index + (adj_opcode / lh->line_range) > + / lh->maximum_ops_per_instruction) > + * lh->minimum_instruction_length); While I understand the VLIW support is not there implemented anyway still here the association is wrong; the division (/) and multiplication (*) should apply even to OP_INDEX. The indentation is inappropriate for the expression (the indentation falsely suggests the calculation is right). > @@ -8195,11 +8238,19 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, > instruction length since special opcode 255 would have > scaled the the increment. */ > case DW_LNS_const_add_pc: > - address += (lh->minimum_instruction_length > - * ((255 - lh->opcode_base) / lh->line_range)); > + { > + CORE_ADDR adjust = (255 - lh->opcode_base) / lh->line_range; > + > + address += (lh->minimum_instruction_length > + * ((op_index + adjust) > + / lh->maximum_ops_per_instruction)); I would prefer unified form of the expressions as an aid to the reader. Here is MINIMUM_INSTRUCTION_LENGTH preceding the rest of the expression while it is succeeding the rest of the expression in the patch chunk above. > + case DW_FORM_exprloc: > + fprintf_unfiltered (f, "expression: size %d", > + DW_BLOCK (&die->attrs[i])->size); > + break; It should be %u. Thanks, Jan