From patchwork Mon Jun 30 15:54:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 1819 Received: (qmail 18096 invoked by alias); 30 Jun 2014 15:54:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 17755 invoked by uid 89); 30 Jun 2014 15:54:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 30 Jun 2014 15:54:37 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5UFsZcT018587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Jun 2014 11:54:36 -0400 Received: from barimba.redhat.com (ovpn-113-95.phx2.redhat.com [10.3.113.95]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5UFsYIJ009257; Mon, 30 Jun 2014 11:54:35 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 2/2] change to_info_record to use target delegation Date: Mon, 30 Jun 2014 09:54:32 -0600 Message-Id: <1404143672-11428-3-git-send-email-tromey@redhat.com> In-Reply-To: <1404143672-11428-1-git-send-email-tromey@redhat.com> References: <1404143672-11428-1-git-send-email-tromey@redhat.com> This changes to_info_record to use target delegation. Also, target_info_record was unused, so this patch removes it. 2014-06-30 Tom Tromey * target-delegates.c: Rebuild. * target.c (target_info_record): Remove. * record.c (info_record_command): Unconditionally call to_info_record. * target.h (struct target_ops) : Use TARGET_DEFAULT_IGNORE. (target_info_record): Remove. --- gdb/ChangeLog | 10 ++++++++++ gdb/record.c | 3 +-- gdb/target.c | 17 ----------------- gdb/target.h | 6 ++---- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/gdb/record.c b/gdb/record.c index acdbc1a..ff54a8b 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -285,8 +285,7 @@ info_record_command (char *args, int from_tty) } printf_filtered (_("Active record target: %s\n"), t->to_shortname); - if (t->to_info_record != NULL) - t->to_info_record (t); + t->to_info_record (t); } /* The "record save" command. */ diff --git a/gdb/target.c b/gdb/target.c index 91756c8..c9c5e4b 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3443,23 +3443,6 @@ target_stop_recording (void) /* See target.h. */ void -target_info_record (void) -{ - struct target_ops *t; - - for (t = current_target.beneath; t != NULL; t = t->beneath) - if (t->to_info_record != NULL) - { - t->to_info_record (t); - return; - } - - tcomplain (); -} - -/* See target.h. */ - -void target_save_record (const char *filename) { current_target.to_save_record (¤t_target, filename); diff --git a/gdb/target.h b/gdb/target.h index cf4ced1..8bf160c 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1022,7 +1022,8 @@ struct target_ops TARGET_DEFAULT_IGNORE (); /* Print information about the recording. */ - void (*to_info_record) (struct target_ops *); + void (*to_info_record) (struct target_ops *) + TARGET_DEFAULT_IGNORE (); /* Save the recorded execution trace into a file. */ void (*to_save_record) (struct target_ops *, const char *filename) @@ -2221,9 +2222,6 @@ extern enum btrace_error target_read_btrace (VEC (btrace_block_s) **, /* See to_stop_recording in struct target_ops. */ extern void target_stop_recording (void); -/* See to_info_record in struct target_ops. */ -extern void target_info_record (void); - /* See to_save_record in struct target_ops. */ extern void target_save_record (const char *filename);