Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Fred Fish <fnf@specifix.com>
Cc: Jim Blandy <jimb@red-bean.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix ptype problem printing typedefs defined differently in different compilation units
Date: Tue, 14 Feb 2006 14:11:00 -0000	[thread overview]
Message-ID: <20060214141056.GB21812@nevyn.them.org> (raw)
In-Reply-To: <200602121349.07257.fnf@specifix.com>

On Sun, Feb 12, 2006 at 01:49:06PM -0500, Fred Fish wrote:
> *** eval.c	30 Dec 2005 18:53:04 -0000	1.1.1.2
> --- eval.c	12 Feb 2006 18:07:29 -0000
> *************** evaluate_subexp_standard (struct type *e
> *** 461,466 ****
> --- 461,472 ----
>   	 value_rtti_target_type () if we are dealing with a pointer
>   	 or reference to a base class and print object is on. */
>   
> +       /* If asked to evaluate a typedef, and we are avoiding side effects,
> + 	 then create a value of the appropriate type to return. */
> +       if (noside == EVAL_AVOID_SIDE_EFFECTS
> + 	  && SYMBOL_CLASS (exp->elts[pc + 2].symbol) == LOC_TYPEDEF)
> + 	return (allocate_value (SYMBOL_TYPE (exp->elts[2].symbol)));
> +       else
>   	return value_of_variable (exp->elts[pc + 2].symbol,
>   				  exp->elts[pc + 1].block);
>   

This patch seems OK to me; but we really ought to fix up the comment
directly above this code that you're changing.

      /* JYG: We used to just return value_zero of the symbol type
         if we're asked to avoid side effects.  Otherwise we return
         value_of_variable (...).  However I'm not sure if
         value_of_variable () has any side effect.
         We need a full value object returned here for whatis_exp ()
         to call evaluate_type () and then pass the full value to
         value_rtti_target_type () if we are dealing with a pointer
         or reference to a base class and print object is on. */

It'd be nice to mention "so now we only do this for typedefs".

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-02-14 14:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-03 20:17 Fred Fish
2006-01-03 23:15 ` Jim Blandy
2006-01-04  2:46   ` Fred Fish
2006-01-04  3:45     ` Jim Blandy
2006-01-04 11:15       ` Fred Fish
2006-01-04 21:04       ` Fred Fish
2006-01-05  0:21         ` Jim Blandy
2006-01-05  0:26         ` Jim Blandy
2006-01-05  0:54           ` Daniel Jacobowitz
2006-01-05  4:47             ` Jim Blandy
2006-01-15 18:48         ` Daniel Jacobowitz
2006-01-16  4:22           ` Jim Blandy
2006-01-23 15:27             ` Fred Fish
2006-01-23 16:12               ` Daniel Jacobowitz
2006-01-23 16:43                 ` Fred Fish
2006-01-23 19:17                   ` Jim Blandy
2006-01-23 19:35                     ` Fred Fish
2006-01-23 20:45                       ` Jim Blandy
2006-02-11  0:39                         ` Fred Fish
2006-02-11 18:35                           ` Daniel Jacobowitz
2006-02-11 19:08                             ` Eli Zaretskii
2006-02-11 20:13                               ` Daniel Jacobowitz
2006-02-11 20:01                             ` Fred Fish
2006-02-11 20:21                               ` Daniel Jacobowitz
2006-02-12 18:49                                 ` Fred Fish
2006-02-14 14:11                                   ` Daniel Jacobowitz [this message]
2006-02-14 18:47                                     ` Fred Fish
2006-02-17  0:17                                     ` Fred Fish
2006-02-17  9:15                                       ` Eli Zaretskii
2006-02-17 13:36                                         ` Fred Fish
2006-02-17 20:32                                         ` Fred Fish
2006-02-18  9:27                                           ` Eli Zaretskii
2006-02-18 22:19                                       ` Daniel Jacobowitz
2006-02-20 15:47                                       ` Fred Fish
2006-02-20 16:23                                         ` Daniel Jacobowitz
2006-05-17 19:04                                           ` Fred Fish
2006-02-11  0:39                         ` Fred Fish
2006-01-24 15:23                     ` [commit] " Fred Fish

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=20060214141056.GB21812@nevyn.them.org \
    --to=drow@false.org \
    --cc=fnf@specifix.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@red-bean.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