Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <hui_zhu@mentor.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [OB PATCH] target.h (to_traceframe_info): Fix TARGET_DEFAULT_RETURN
Date: Tue, 04 Mar 2014 01:18:00 -0000	[thread overview]
Message-ID: <531529CB.2020400@mentor.com> (raw)
In-Reply-To: <53152341.8060501@codesourcery.com>

On 03/04/14 08:50, Yao Qi wrote:
> On 02/25/2014 11:55 PM, Hui Zhu wrote:
>> make-target-delegates target.h >target-delegates.c
>> git diff target-delegates.c
>> diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
>> index 5b27b59..fdea5d6 100644
>> --- a/gdb/target-delegates.c
>> +++ b/gdb/target-delegates.c
>> @@ -1297,7 +1297,7 @@ delegate_traceframe_info (struct target_ops *self)
>>    static struct traceframe_info *
>>    tdefault_traceframe_info (struct target_ops *self)
>>    {
>> -  return NULL;
>> +  return tcomplain ();
>>    }
>>
>> Committed as obvious.
>
> This patch isn't correct to me.
>
>>
>> Thanks,
>> Hui
>>
>> 2014-02-25  Hui Zhu  <hui@codesourcery.com>
>>
>> 	* target.h (target_ops): Fix TARGET_DEFAULT_RETURN of
>> 	to_traceframe_info.
>>
>> diff --git a/gdb/target.h b/gdb/target.h
>> index db248a8..7ce66c1 100644
>> --- a/gdb/target.h
>> +++ b/gdb/target.h
>> @@ -976,7 +976,7 @@ struct target_ops
>>           higher layers take care of caching, invalidating, and
>>           re-fetching when necessary.  */
>>        struct traceframe_info *(*to_traceframe_info) (struct target_ops *)
>> -       TARGET_DEFAULT_RETURN (tcomplain ());
>> +       TARGET_DEFAULT_RETURN (NULL);
>
> It is intended to call tcomplain in the default implementation of
> to_traceframe_info interface, see patch [1]
>
> The inconsistency between target.h and target-delegates.c is a
> good catch, but your fix isn't correct.  When patch [1] was being
> reviewed, Tom pushed the target-delegation patch series, I rebase patch
> [1] and resolve conflicts.  I forgot to re-generate target-delegates.c
> and it causes the inconsistency you found.  Sorry about this.


I cannot understand about this OB is not right.  I have 2 questions to you:
1. Before my patch, does target-delegates.c that generated by make-target-delegates is same with current target-delegates.c?
2. Does this new target-delegates.c that generated by make-target-delegates can be built success?

Thanks,
Hui

>
> The right fix to me is to revert your patch and run
> make-target-delegates again so that tdefault_traceframe_info calls
> tcomplain.
>
> [1] [PATCH 8/8] Call target_traceframe_info when traceframe is selected.
>      https://sourceware.org/ml/gdb-patches/2014-02/msg00385.html
>


  reply	other threads:[~2014-03-04  1:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 15:55 Hui Zhu
2014-03-04  0:52 ` Yao Qi
2014-03-04  1:18   ` Hui Zhu [this message]
2014-03-04  1:38     ` Yao Qi
2014-03-05  1:17       ` Yao Qi
2014-03-05 20:04         ` Tom Tromey
2014-03-06  2:21           ` Yao Qi

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=531529CB.2020400@mentor.com \
    --to=hui_zhu@mentor.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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