Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Hui Zhu <hui_zhu@mentor.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [OB PATCH] target.h (to_traceframe_info): Fix TARGET_DEFAULT_RETURN
Date: Wed, 05 Mar 2014 01:17:00 -0000	[thread overview]
Message-ID: <53167A7F.1060702@codesourcery.com> (raw)
In-Reply-To: <53152E0B.9090107@codesourcery.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


  reply	other threads:[~2014-03-05  1:17 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
2014-03-04  1:38     ` Yao Qi
2014-03-05  1:17       ` Yao Qi [this message]
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=53167A7F.1060702@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@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