From patchwork Tue Mar 26 14:44:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31992 Received: (qmail 29028 invoked by alias); 26 Mar 2019 14:53:19 -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 27756 invoked by uid 89); 26 Mar 2019 14:53:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1820, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 26 Mar 2019 14:53:17 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 37A07116C72; Tue, 26 Mar 2019 10:44:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EW1EIBMZx7OP; Tue, 26 Mar 2019 10:44:08 -0400 (EDT) Received: from murgatroyd.Home (174-29-37-56.hlrn.qwest.net [174.29.37.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id D5715116C5F; Tue, 26 Mar 2019 10:44:07 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 4/8] Use gdb::function_view in iterate_over_live_ada_tasks Date: Tue, 26 Mar 2019 08:44:00 -0600 Message-Id: <20190326144404.6670-5-tromey@adacore.com> In-Reply-To: <20190326144404.6670-1-tromey@adacore.com> References: <20190326144404.6670-1-tromey@adacore.com> MIME-Version: 1.0 This changes iterate_over_live_ada_tasks to accept a gdb::function_view. This is needed by a subsequent patch. gdb/ChangeLog 2019-03-26 Tom Tromey * ada-lang.h (ada_task_list_iterator_ftype): Now a gdb::function_view. (iterate_over_live_ada_tasks): Change type of argument. * ada-tasks.c (iterate_over_live_ada_tasks): Change type of argument. --- gdb/ChangeLog | 8 ++++++++ gdb/ada-lang.h | 6 ++++-- gdb/ada-tasks.c | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gdb/ada-lang.h b/gdb/ada-lang.h index ee03dbd2aad..d79e5f0d5ac 100644 --- a/gdb/ada-lang.h +++ b/gdb/ada-lang.h @@ -28,6 +28,7 @@ struct parser_state; #include "value.h" #include "gdbtypes.h" #include "breakpoint.h" +#include "common/function-view.h" #include "common/vec.h" /* Names of specific files known to be part of the runtime @@ -405,9 +406,10 @@ extern struct ada_task_info *ada_get_task_info_from_ptid (ptid_t ptid); extern int ada_get_task_number (thread_info *thread); -typedef void (ada_task_list_iterator_ftype) (struct ada_task_info *task); +typedef gdb::function_view + ada_task_list_iterator_ftype; extern void iterate_over_live_ada_tasks - (ada_task_list_iterator_ftype *iterator); + (ada_task_list_iterator_ftype iterator); extern const char *ada_get_tcb_types_info (void); diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index ccabc631040..09b28a45af0 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -387,7 +387,7 @@ ada_get_task_info_from_ptid (ptid_t ptid) terminated yet. */ void -iterate_over_live_ada_tasks (ada_task_list_iterator_ftype *iterator) +iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator) { struct ada_tasks_inferior_data *data;