From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27484 invoked by alias); 6 Feb 2014 20:58:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27435 invoked by uid 89); 6 Feb 2014 20:58:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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 ESMTP; Thu, 06 Feb 2014 20:58:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s16Ktods003769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Feb 2014 15:55:50 -0500 Received: from barimba.redhat.com (ovpn-113-148.phx2.redhat.com [10.3.113.148]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s16KtfZW013306; Thu, 6 Feb 2014 15:55:49 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC v2 11/38] Add target_ops argument to to_get_ada_task_ptid Date: Thu, 06 Feb 2014 20:58:00 -0000 Message-Id: <1391720136-2121-12-git-send-email-tromey@redhat.com> In-Reply-To: <1391720136-2121-1-git-send-email-tromey@redhat.com> References: <1391720136-2121-1-git-send-email-tromey@redhat.com> X-SW-Source: 2014-02/txt/msg00159.txt.bz2 2014-02-06 Tom Tromey * windows-nat.c (windows_get_ada_task_ptid): Add 'self' argument. * target.h (struct target_ops) : Add argument. (target_get_ada_task_ptid): Add argument. * target.c (update_current_target): Update. (default_get_ada_task_ptid): Add 'self' argument. * sol-thread.c (sol_get_ada_task_ptid): Add 'self' argument. * remote.c (remote_get_ada_task_ptid): Add 'self' argument. * ravenscar-thread.c (ravenscar_get_ada_task_ptid): Add 'self' argument. * linux-thread-db.c (thread_db_get_ada_task_ptid): Add 'self' argument. * inf-ttrace.c (inf_ttrace_get_ada_task_ptid): Add 'self' argument. * dec-thread.c (dec_thread_get_ada_task_ptid): Add 'self' argument. * darwin-nat.c (darwin_get_ada_task_ptid): Add 'self' argument. * aix-thread.c (aix_thread_get_ada_task_ptid): Add 'self' argument. --- gdb/ChangeLog | 22 ++++++++++++++++++++++ gdb/aix-thread.c | 2 +- gdb/darwin-nat.c | 2 +- gdb/dec-thread.c | 5 +++-- gdb/inf-ttrace.c | 2 +- gdb/linux-thread-db.c | 2 +- gdb/ravenscar-thread.c | 2 +- gdb/remote.c | 2 +- gdb/sol-thread.c | 2 +- gdb/target.c | 4 ++-- gdb/target.h | 5 +++-- gdb/windows-nat.c | 2 +- 12 files changed, 38 insertions(+), 14 deletions(-) diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 3597d3c..087f7f8 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -1808,7 +1808,7 @@ aix_thread_extra_thread_info (struct target_ops *self, } static ptid_t -aix_thread_get_ada_task_ptid (long lwp, long thread) +aix_thread_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { return ptid_build (ptid_get_pid (inferior_ptid), 0, thread); } diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 70b03a9..2a716bc 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1992,7 +1992,7 @@ darwin_pid_to_exec_file (struct target_ops *self, int pid) } static ptid_t -darwin_get_ada_task_ptid (long lwp, long thread) +darwin_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { int i; darwin_thread_t *t; diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c index b9a1c68..e7cecc4 100644 --- a/gdb/dec-thread.c +++ b/gdb/dec-thread.c @@ -687,12 +687,13 @@ dec_thread_new_objfile_observer (struct objfile *objfile) /* The "to_get_ada_task_ptid" method of the dec_thread_ops. */ static ptid_t -dec_thread_get_ada_task_ptid (long lwp, long thread) +dec_thread_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { int i; struct dec_thread_info *info; - debug ("dec_thread_get_ada_task_ptid (lwp=0x%lx, thread=0x%lx)", + debug ("dec_thread_get_ada_task_ptid (struct target_ops *self, + lwp=0x%lx, thread=0x%lx)", lwp, thread); for (i = 0; VEC_iterate (dec_thread_info_s, dec_thread_list, i, info); diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c index c7b2856..c91fc68 100644 --- a/gdb/inf-ttrace.c +++ b/gdb/inf-ttrace.c @@ -1304,7 +1304,7 @@ inf_ttrace_pid_to_str (struct target_ops *ops, ptid_t ptid) /* Implement the get_ada_task_ptid target_ops method. */ static ptid_t -inf_ttrace_get_ada_task_ptid (long lwp, long thread) +inf_ttrace_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { return ptid_build (ptid_get_pid (inferior_ptid), lwp, 0); } diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 9180464..cf7adc4 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1875,7 +1875,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data) /* Implement the to_get_ada_task_ptid target method for this target. */ static ptid_t -thread_db_get_ada_task_ptid (long lwp, long thread) +thread_db_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { struct thread_info *thread_info; diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 12d0247..7002971 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -352,7 +352,7 @@ ravenscar_inferior_created (struct target_ops *target, int from_tty) } static ptid_t -ravenscar_get_ada_task_ptid (long lwp, long thread) +ravenscar_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { return ptid_build (ptid_get_pid (base_ptid), 0, thread); } diff --git a/gdb/remote.c b/gdb/remote.c index fde6942..0e24500 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3037,7 +3037,7 @@ remote_static_tracepoint_markers_by_strid (const char *strid) /* Implement the to_get_ada_task_ptid function for the remote targets. */ static ptid_t -remote_get_ada_task_ptid (long lwp, long thread) +remote_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { return ptid_build (ptid_get_pid (inferior_ptid), 0, lwp); } diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c index f39f8bb..81f19fc 100644 --- a/gdb/sol-thread.c +++ b/gdb/sol-thread.c @@ -1190,7 +1190,7 @@ thread_db_find_thread_from_tid (struct thread_info *thread, void *data) } static ptid_t -sol_get_ada_task_ptid (long lwp, long thread) +sol_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { struct thread_info *thread_info = iterate_over_threads (thread_db_find_thread_from_tid, &thread); diff --git a/gdb/target.c b/gdb/target.c index ec48d40..1716c45 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -537,7 +537,7 @@ default_terminal_info (struct target_ops *self, const char *args, int from_tty) inferior_ptid. */ static ptid_t -default_get_ada_task_ptid (long lwp, long tid) +default_get_ada_task_ptid (struct target_ops *self, long lwp, long tid) { return ptid_build (ptid_get_pid (inferior_ptid), lwp, tid); } @@ -837,7 +837,7 @@ update_current_target (void) default_thread_architecture); current_target.to_read_description = NULL; de_fault (to_get_ada_task_ptid, - (ptid_t (*) (long, long)) + (ptid_t (*) (struct target_ops *, long, long)) default_get_ada_task_ptid); de_fault (to_supports_multi_process, (int (*) (void)) diff --git a/gdb/target.h b/gdb/target.h index c315bcb..419842f 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -628,7 +628,8 @@ struct target_ops based on LWP and THREAD. These values are extracted from the task Private_Data section of the Ada Task Control Block, and their interpretation depends on the target. */ - ptid_t (*to_get_ada_task_ptid) (long lwp, long thread); + ptid_t (*to_get_ada_task_ptid) (struct target_ops *, + long lwp, long thread); /* Read one auxv entry from *READPTR, not reading locations >= ENDPTR. Return 0 if *READPTR is already at the end of the buffer. @@ -1689,7 +1690,7 @@ extern int target_masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask); extern const struct target_desc *target_read_description (struct target_ops *); #define target_get_ada_task_ptid(lwp, tid) \ - (*current_target.to_get_ada_task_ptid) (lwp,tid) + (*current_target.to_get_ada_task_ptid) (¤t_target, lwp,tid) /* Utility implementation of searching memory. */ extern int simple_search_memory (struct target_ops* ops, diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 91af87b..0af13df 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -2580,7 +2580,7 @@ windows_get_tib_address (ptid_t ptid, CORE_ADDR *addr) } static ptid_t -windows_get_ada_task_ptid (long lwp, long thread) +windows_get_ada_task_ptid (struct target_ops *self, long lwp, long thread) { return ptid_build (ptid_get_pid (inferior_ptid), 0, lwp); } -- 1.8.1.4