public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Stan Shebs <stanshebs@earthlink.net>
To: Hui Zhu <hui_zhu@mentor.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: What about merge function gen_trace_for_expr and function gen_eval_for_expr together?
Date: Tue, 12 Jun 2012 01:49:00 -0000	[thread overview]
Message-ID: <4FD6A000.7010804@earthlink.net> (raw)
In-Reply-To: <4FD68A3D.7030807@mentor.com>

On 6/11/12 5:15 PM, Hui Zhu wrote:
> Hi guys,
>
> When I read the code, I found that most part of these functions are same:
> 2c2
> < gen_trace_for_expr (CORE_ADDR scope, struct expression *expr)
> ---
>> gen_eval_for_expr (CORE_ADDR scope, struct expression *expr)
> 12c12
> <   trace_kludge = 1;
> ---
>>   trace_kludge = 0;
> 16,17c16
> <   /* Make sure we record the final object, and get rid of it.  */
> <   gen_traced_pop (expr->gdbarch, ax, &value);
> ---
>>   require_rvalue (ax, &value);
>
>
> What about add a new argument for example trace or eval and merge them 
> together?

I certainly considered that when introducing gen_eval_for_expr, but it 
seemed like repeatedly testing a flag for the parts that are different 
was going to make it more complicated than having the two separate 
functions.  I also expected that they might need to diverge a bit more 
over time, for instance if trace_kludge were to be gotten rid of (as it 
should be).

Stan
stan@codesourcery.com

      reply	other threads:[~2012-06-12  1:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12  0:16 Hui Zhu
2012-06-12  1:49 ` Stan Shebs [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=4FD6A000.7010804@earthlink.net \
    --to=stanshebs@earthlink.net \
    --cc=gdb@sourceware.org \
    --cc=hui_zhu@mentor.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).