This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [OB PATCH] target.h (to_traceframe_info): Fix TARGET_DEFAULT_RETURN


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.

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

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]