From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6653 invoked by alias); 22 Jul 2012 07:47:25 -0000 Received: (qmail 6640 invoked by uid 22791); 22 Jul 2012 07:47:24 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,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; Sun, 22 Jul 2012 07:47:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6M7l78i018577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 22 Jul 2012 03:47:08 -0400 Received: from spoyarek (vpn-236-237.phx2.redhat.com [10.3.236.237]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6M7l5Z2024651 for ; Sun, 22 Jul 2012 03:47:06 -0400 Date: Sun, 22 Jul 2012 07:47:00 -0000 From: Siddhesh Poyarekar To: gdb-patches@sourceware.org Subject: [PATCH] Make SIZE element for dwarf_block as size_t Message-ID: <20120722131658.2809309e@spoyarek> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/8P2Io1a+tWcTtwqm+uyU3Wa" 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: 2012-07/txt/msg00422.txt.bz2 --MP_/8P2Io1a+tWcTtwqm+uyU3Wa Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 953 Hi, dwarf_block.SIZE should be size_t to accept larger data blocks in case of DW_FORM_block, since the size of the length of a DW_FORM_block is not specified and can be anything encoded in a uleb128. The dwarf2_loclist_baton and dwarf2_locexpr_baton SIZE members also need to be made size_t just to eliminate splint warnings. I have run the testsuite on x86_64 to ensure that there are no regressions. This was part of the bitpos-expand[1] change that I am currently reviewing and I realized that this could go in as a separate independent change. Does this look OK to commit? Thanks, Siddhesh gdb/ChangeLog: 2012-07-22 Siddhesh Poyarekar * dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as size_t. (struct dwarf2_loclist_baton): Likewise. * dwarf2read.c (struct dwarf_block): Likewise. (dump_die_shallow): Use pulongest to print dwarf_block.size. [1] http://sourceware.org/ml/gdb-patches/2012-06/msg00851.html --MP_/8P2Io1a+tWcTtwqm+uyU3Wa Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dwblock-size.patch Content-length: 1652 diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h index e9d06a3..0f2af3c 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h @@ -97,7 +97,7 @@ struct dwarf2_locexpr_baton /* Length of the location expression. For optimized out expressions it is zero. */ - unsigned long size; + size_t size; /* The compilation unit containing the symbol whose location we're computing. */ @@ -114,7 +114,7 @@ struct dwarf2_loclist_baton const gdb_byte *data; /* Length of the location list. */ - unsigned long size; + size_t size; /* The compilation unit containing the symbol whose location we're computing. */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 187d1e8..6f671c7 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -887,7 +887,7 @@ struct die_info /* Blocks are a bunch of untyped bytes. */ struct dwarf_block { - unsigned int size; + size_t size; /* Valid only if SIZE is not zero. */ gdb_byte *data; @@ -15074,12 +15074,12 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) case DW_FORM_block4: case DW_FORM_block: case DW_FORM_block1: - fprintf_unfiltered (f, "block: size %d", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "block: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_exprloc: - fprintf_unfiltered (f, "expression: size %u", - DW_BLOCK (&die->attrs[i])->size); + fprintf_unfiltered (f, "expression: size %s", + pulongest (DW_BLOCK (&die->attrs[i])->size)); break; case DW_FORM_ref_addr: fprintf_unfiltered (f, "ref address: "); --MP_/8P2Io1a+tWcTtwqm+uyU3Wa--