This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [OB PATCH] target.h (to_traceframe_info): Fix TARGET_DEFAULT_RETURN
- From: Yao Qi <yao at codesourcery dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Wed, 5 Mar 2014 09:14:39 +0800
- Subject: Re: [OB PATCH] target.h (to_traceframe_info): Fix TARGET_DEFAULT_RETURN
- Authentication-results: sourceware.org; auth=none
- References: <530CBCED dot 3000200 at mentor dot com> <53152341 dot 8060501 at codesourcery dot com> <531529CB dot 2020400 at mentor dot com> <53152E0B dot 9090107 at codesourcery dot com>
On 03/04/2014 09:36 AM, Yao Qi wrote:
> No, we should use TARGET_DEFAULT_NORETURN instead of
> TARGET_DEFAULT_RETURN, which is a mistake when I resolved conflicts.
>
> struct traceframe_info *(*to_traceframe_info) (struct target_ops *)
> TARGET_DEFAULT_NORETURN (tcomplain ());
Here is a patch to do so. Regression tested on x86_64-linux. I'll push
it in in two days.
From: Yao Qi <yao@codesourcery.com>
Date: Tue, 4 Mar 2014 17:39:10 +0800
Subject: [PATCH] Change the default implementation of to_traceframe_info to tcomplain
This patch is to change the default implementation of to_traceframe_info
from 'return NULL' to tcomplain, which is intended. If new target
supports tracepoint, this method should be implemented, otherwise,
an error is thrown.
gdb:
2014-03-04 Yao Qi <yao@codesourcery.com>
* target.h (struct target_ops) <to_traceframe_info>: Use
TARGET_DEFAULT_NORETURN (tcomplain ()).
* target-delegates.c: Regenerated.
---
gdb/target-delegates.c | 2 +-
gdb/target.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index 5b27b59..3ca24b7 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;
+ tcomplain ();
}
static int
diff --git a/gdb/target.h b/gdb/target.h
index ab797b2..91f0cc9 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -950,7 +950,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 (NULL);
+ TARGET_DEFAULT_NORETURN (tcomplain ());
/* Ask the target to use or not to use agent according to USE. Return 1
successful, 0 otherwise. */
--
1.7.7.6