From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/5] Update comments in struct value for non-8-bits architectures
Date: Mon, 27 Jul 2015 21:46:00 -0000 [thread overview]
Message-ID: <55B6A69F.5010205@ericsson.com> (raw)
In-Reply-To: <55B22109.5020500@redhat.com>
On 15-07-24 07:27 AM, Pedro Alves wrote:
> On 07/16/2015 07:51 PM, Simon Marchi wrote:
>> gdb/ChangeLog:
>>
>> * value.c (struct value): Update comments.
>
> Looks good to me, though as mentioned in the other patch, I think
> these comments should be explicit in saying "host" and "target". These are
> central structures that people study first, and being crystal clear
> should help grasp the byte vs memory units concepts sooner.
>
> Thanks,
> Pedro Alves
Updated version:
From 4441bdcc4e55d2397d2ca7918669a1ccf1676a25 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Thu, 2 Jul 2015 17:52:40 -0400
Subject: [PATCH] Update comments in struct value for non-8-bits architectures
gdb/ChangeLog:
* value.c (struct value): Update comments.
---
gdb/value.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/gdb/value.c b/gdb/value.c
index 4399493..7fb7e2b 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 target
+ 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
- most GDB code continues to see the `type' portion of the value,
- just as the inferior would.
+ offset of `type' within that larger type, in target 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 target 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
--
2.1.4
next prev parent reply other threads:[~2015-07-27 21:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 18:51 [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Simon Marchi
2015-07-16 18:51 ` [PATCH 5/5] Add new test internalvar.exp Simon Marchi
2015-07-24 11:41 ` Pedro Alves
2015-07-16 18:51 ` [PATCH 3/5] Introduce get_value_arch Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 21:47 ` Simon Marchi
2015-07-28 10:25 ` Pedro Alves
2015-07-28 14:56 ` Simon Marchi
2015-07-28 15:06 ` Simon Marchi
2015-07-16 18:51 ` [PATCH 4/5] Consider addressable memory unit size in various value functions Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 22:05 ` Simon Marchi
2015-07-28 10:29 ` Pedro Alves
2015-07-28 15:07 ` Simon Marchi
2015-07-16 18:51 ` [PATCH 2/5] Update comments in struct value for non-8-bits architectures Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 21:46 ` Simon Marchi [this message]
2015-07-28 10:20 ` Pedro Alves
2015-07-24 11:26 ` [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Pedro Alves
2015-07-27 21:37 ` Simon Marchi
2015-07-28 10:19 ` Pedro Alves
2015-07-28 15:04 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55B6A69F.5010205@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).