Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Tom Tromey <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [committed]: [PATCH 0/4] Fix member pointer bugs
Date: Thu, 29 Nov 2012 07:46:00 -0000	[thread overview]
Message-ID: <50B712B2.9020900@codesourcery.com> (raw)
In-Reply-To: <87y5hladko.fsf@fleche.redhat.com>

On 11/29/2012 12:37 AM, Tom Tromey wrote:
> index 55582e0..faad9e3 100644
> --- a/gdb/eval.c
> +++ b/gdb/eval.c
> @@ -1410,7 +1410,7 @@ evaluate_subexp_standard (struct type *expect_type,
>   
>   	      mem_offset = value_as_long (arg1);
>   
> -	      arg1 = value_from_pointer (type_ptr,
> +	      arg1 = value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
>   					 value_as_long (arg2) + mem_offset);
>   	      arg1 = value_ind (arg1);
>   	      tem = 1;

TYPE_TARGET_TYPE (type) was used in my first post, but it was replaced
by TYPE_DOMAIN_TYPE (type) by mistake in my follow-up patch, which is
to shorten the line.  I didn't run regression test again after the change.
Thanks for pointing this out.

The patch below is the same to yours, but shorten the line by defining a
new local variable.  Regression tested on x86_64-linux.  Committed.

-- 
Yao (齐尧)

gdb:

2012-11-29  Yao Qi  <yao@codesourcery.com>
	    Tom Tromey  <tromey@redhat.com>

	* eval.c (evaluate_subexp_standard): Get the correct pointer
	type for TYPE_CODE_MEMBERPTR.
---
 gdb/eval.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gdb/eval.c b/gdb/eval.c
index 55582e0..7d48d7e 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1404,13 +1404,15 @@ evaluate_subexp_standard (struct type *expect_type,
 	    {
 	      struct type *type_ptr
 		= lookup_pointer_type (TYPE_DOMAIN_TYPE (type));
+	      struct type *target_type_ptr
+		= lookup_pointer_type (TYPE_TARGET_TYPE (type));
 
 	      /* Now, convert these values to an address.  */
 	      arg2 = value_cast (type_ptr, arg2);
 
 	      mem_offset = value_as_long (arg1);
 
-	      arg1 = value_from_pointer (type_ptr,
+	      arg1 = value_from_pointer (target_type_ptr,
 					 value_as_long (arg2) + mem_offset);
 	      arg1 = value_ind (arg1);
 	      tem = 1;
-- 
1.7.7.6


      reply	other threads:[~2012-11-29  7:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  7:32 Yao Qi
2012-11-22  7:32 ` [PATCH 1/4] testcase - pointer to member function Yao Qi
2012-11-26 16:32   ` Tom Tromey
2012-11-22  7:33 ` [PATCH 3/4] Use TYPE_TARGET_TYPE Yao Qi
2012-11-26 16:41   ` Tom Tromey
2012-11-22  7:33 ` [PATCH 4/4] Handle TYPE_CODE_MEMBERPTR Yao Qi
2012-11-22  8:07   ` Yao Qi
2012-11-26 16:42     ` Tom Tromey
2012-11-22  7:33 ` [PATCH 2/4] factor code Yao Qi
2012-11-27  8:03 ` [committed]: [PATCH 0/4] Fix member pointer bugs Yao Qi
2012-11-28 14:47   ` Tom Tromey
2012-11-28 15:14     ` Yao Qi
2012-11-28 16:37       ` Tom Tromey
2012-11-29  7:46         ` Yao Qi [this message]

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=50B712B2.9020900@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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