From patchwork Thu Jul 16 18:51:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 7724 Received: (qmail 121420 invoked by alias); 16 Jul 2015 18:51:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 120230 invoked by uid 89); 16 Jul 2015 18:51:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 16 Jul 2015 18:51:38 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 3B.63.07675.77597A55; Thu, 16 Jul 2015 13:28:56 +0200 (CEST) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.81) with Microsoft SMTP Server (TLS) id 14.3.210.2; Thu, 16 Jul 2015 14:51:34 -0400 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 2/5] Update comments in struct value for non-8-bits architectures Date: Thu, 16 Jul 2015 14:51:21 -0400 Message-ID: <1437072684-26565-2-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1437072684-26565-1-git-send-email-simon.marchi@ericsson.com> References: <1437072684-26565-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes gdb/ChangeLog: * value.c (struct value): Update comments. --- gdb/value.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gdb/value.c b/gdb/value.c index 4399493..6314036 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -234,11 +234,11 @@ struct value } computed; } location; - /* Describes offset of a value within lval of a structure in bytes. - If lval == lval_memory, this is an offset to the address. If - lval == lval_register, this is a further offset from - location.address within the registers structure. Note also the - member embedded_offset below. */ + /* Describes offset of a value within lval of a structure in addressable + memory units. If lval == lval_memory, this is an offset to the address. + If lval == lval_register, this is a further offset from location.address + within the registers structure. Note also the member embedded_offset + below. */ int offset; /* Only used for bitfields; number of bits contained in them. */ @@ -291,19 +291,19 @@ struct value When we store the entire object, `enclosing_type' is the run-time type -- the complete object -- and `embedded_offset' is the - offset of `type' within that larger type, in bytes. The - value_contents() macro takes `embedded_offset' into account, so + offset of `type' within that larger type, in addressable memory units. + The value_contents() macro takes `embedded_offset' into account, so most GDB code continues to see the `type' portion of the value, just as the inferior would. If `type' is a pointer to an object, then `enclosing_type' is a pointer to the object's run-time type, and `pointed_to_offset' is - the offset in bytes from the full object to the pointed-to object - -- that is, the value `embedded_offset' would have if we followed - the pointer and fetched the complete object. (I don't really see - the point. Why not just determine the run-time type when you - indirect, and avoid the special case? The contents don't matter - until you indirect anyway.) + the offset in addressable memory units from the full object to the + pointed-to object -- that is, the value `embedded_offset' would + have if we followed the pointer and fetched the complete object. + (I don't really see the point. Why not just determine the + run-time type when you indirect, and avoid the special case? The + contents don't matter until you indirect anyway.) If we're not doing anything fancy, `enclosing_type' is equal to `type', and `embedded_offset' is zero, so everything works