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: RFC: remove trace_kludge global
Date: Tue, 12 Mar 2013 03:33:00 -0000	[thread overview]
Message-ID: <513EA1B0.6000005@codesourcery.com> (raw)
In-Reply-To: <87k3pdn3es.fsf@fleche.redhat.com>

Hi, Tom,

On 03/12/2013 03:26 AM, Tom Tromey wrote:
> @@ -2608,17 +2585,18 @@ agent_eval_command_one (char *exp, int eval, CORE_ADDR pc)
>     struct cleanup *old_chain = 0;
>     struct expression *expr;
>     struct agent_expr *agent;
> +  int trace_string = 0;
>
>     if (!eval)
>       {
> -      trace_string_kludge = 0;
>         if (*exp == '/')
> -        exp = decode_agent_options (exp);
> +        exp = decode_agent_options (exp, &trace_string);

'trace_string' is only set when 'eval' is zero, so...

>       }
>
>     if (!eval && strcmp (exp, "$_ret") == 0)
>       {
> -      agent = gen_trace_for_return_address (pc, get_current_arch ());
> +      agent = gen_trace_for_return_address (pc, get_current_arch (),
> +					    trace_string);
>         old_chain = make_cleanup_free_agent_expr (agent);
>       }
>     else
> @@ -2626,9 +2604,9 @@ agent_eval_command_one (char *exp, int eval, CORE_ADDR pc)
>         expr = parse_exp_1 (&exp, pc, block_for_pc (pc), 0);
>         old_chain = make_cleanup (free_current_contents, &expr);
>         if (eval)
> -	agent = gen_eval_for_expr (pc, expr);
> +	agent = gen_eval_for_expr (pc, expr, trace_string);

... 'trace_string' should be zero here.  On the other hand, when 'eval' 
is true, we are evaluating the result of the expression, so no tracing 
stuff should be involved.  So, we don't have to add the new argument 
'trace_string' to gen_eval_for_expr, and set 'ax->trace_string' to zero 
inside gen_eval_for_expr, and the callers of gen_eval_for_expr are not 
updated.

>         else
> -	agent = gen_trace_for_expr (pc, expr);
> +	agent = gen_trace_for_expr (pc, expr, trace_string);
>         make_cleanup_free_agent_expr (agent);
>       }
-- 
Yao (齐尧)


  reply	other threads:[~2013-03-12  3:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 19:27 Tom Tromey
2013-03-12  3:33 ` Yao Qi [this message]
2013-03-12 14:12   ` Tom Tromey
2013-03-12 15:40     ` Tom Tromey
2013-03-13  8:48       ` Yao Qi
2013-03-21 16:15       ` Tom Tromey

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=513EA1B0.6000005@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