From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40956 invoked by alias); 21 Nov 2017 16:16:55 -0000 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 Received: (qmail 40943 invoked by uid 89); 21 Nov 2017 16:16:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Nov 2017 16:16:49 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 54A635F16D for ; Tue, 21 Nov 2017 16:16:48 +0000 (UTC) Received: from localhost (unused-10-15-17-193.yyz.redhat.com [10.15.17.193]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D3495D977 for ; Tue, 21 Nov 2017 16:16:48 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Subject: Re: [PATCH] Implement pahole-like 'ptype /o' option References: <20171121160709.23248-1-sergiodj@redhat.com> Date: Tue, 21 Nov 2017 16:16:00 -0000 In-Reply-To: <20171121160709.23248-1-sergiodj@redhat.com> (Sergio Durigan Junior's message of "Tue, 21 Nov 2017 11:07:09 -0500") Message-ID: <87eforobdc.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00439.txt.bz2 On Tuesday, November 21 2017, I wrote: [...] > diff --git a/gdb/testsuite/gdb.base/ptype-offsets.cc b/gdb/testsuite/gdb.base/ptype-offsets.cc > new file mode 100644 > index 0000000000..f6f845db74 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/ptype-offsets.cc > @@ -0,0 +1,77 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2017 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +/* This file will be used to test 'ptype /o' on x86_64 only. */ > + > +#include > + > +/* A struct with many types of fields, in order to test 'ptype > + /o'. */ > + > +struct abc > +{ > + /* Virtual destructor. */ > + virtual ~abc () > + {} > + > + /* 8-byte address. Because of the virtual destructor above, this > + field's offset will be 8. */ > + void *field1; > + > + /* No hole here. */ > + > + /* 4-byte int bitfield of 1-bit. */ > + unsigned int field2 : 1; > + > + /* 31-bit hole here. */ > + > + /* 4-byte int. */ > + int field3; > + > + /* No hole here. */ > + > + /* 1-byte char. */ > + char field4; > + > + /* 3-byte hole here. */ This should be "7-byte hole". I've updated my local tree. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/