From patchwork Mon Jun 25 16:52:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 28022 Received: (qmail 68731 invoked by alias); 25 Jun 2018 16:52:12 -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 68667 invoked by uid 89); 25 Jun 2018 16:52:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=spell X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Jun 2018 16:52:09 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31E3B70210 for ; Mon, 25 Jun 2018 16:52:08 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE8F72026D5B for ; Mon, 25 Jun 2018 16:52:07 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] gdb: For macOS, s/thread_info/struct thread_info/ Date: Mon, 25 Jun 2018 17:52:06 +0100 Message-Id: <20180625165206.16884-1-palves@redhat.com> The macOS build currently fails with several instances of this problem: In file included from ../../src/gdb/darwin-nat.h:22:0, from ../../src/gdb/i386-darwin-nat.c:37: ../../src/gdb/gdbthread.h:376:59: error: type/value mismatch at argument 1 in template parameter list for 'template class gdb::ref_ptr' = gdb::ref_ptr; ^ ../../src/gdb/gdbthread.h:376:59: note: expected a type, got 'thread_info' ../../src/gdb/gdbthread.h:396:28: error: variable or field 'delete_thread' declared void extern void delete_thread (thread_info *thread); ^ (...) This is because there's a thread_info function in the Darwin/XNU/mach API: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_info.html Fix this in the same way it had been fixed in commit 7aabaf9d4ad5 ("Create private_thread_info hierarchy"), by adding an explicit "struct" keyword. gdb/ChangeLog: 2018-06-25 Pedro Alves * gdbthread.h (thread_info_ref, delete_thread) (delete_thread_silent, first_thread_of_inferior) (any_thread_of_inferior, switch_to_thread) (enable_thread_stack_temporaries) (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary) (value_in_thread_stack_temporaries, can_access_registers_thread): Spell out "struct thread_info" instead of just "thread_info". * inferior.h (notice_new_inferior): Likewise. --- gdb/ChangeLog | 12 ++++++++++++ gdb/gdbthread.h | 28 ++++++++++++++-------------- gdb/inferior.h | 2 +- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4a3f7183a51..be8383eb0ac 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2018-06-25 Pedro Alves + + * gdbthread.h (thread_info_ref, delete_thread) + (delete_thread_silent, first_thread_of_inferior) + (any_thread_of_inferior, switch_to_thread) + (enable_thread_stack_temporaries) + (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) + (get_last_thread_stack_temporary) + (value_in_thread_stack_temporaries, can_access_registers_thread): + Spell out "struct thread_info" instead of just "thread_info". + * inferior.h (notice_new_inferior): Likewise. + 2018-06-25 Pedro Alves * windows-nat.c (windows_delete_thread): Use find_thread_ptid and diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index bd5ab9193f9..ec607bb8c0d 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -373,7 +373,7 @@ public: /* A gdb::ref_ptr pointer to a thread_info. */ using thread_info_ref - = gdb::ref_ptr; + = gdb::ref_ptr; /* Create an empty thread list, or empty the existing one. */ extern void init_thread_list (void); @@ -393,12 +393,12 @@ extern struct thread_info *add_thread_with_info (ptid_t ptid, struct private_thread_info *); /* Delete an existing thread list entry. */ -extern void delete_thread (thread_info *thread); +extern void delete_thread (struct thread_info *thread); /* Delete an existing thread list entry, and be quiet about it. Used after the process this thread having belonged to having already exited, for example. */ -extern void delete_thread_silent (thread_info *thread); +extern void delete_thread_silent (struct thread_info *thread); /* Delete a step_resume_breakpoint from the thread database. */ extern void delete_step_resume_breakpoint (struct thread_info *); @@ -448,15 +448,15 @@ struct thread_info *find_thread_by_handle (struct value *thread_handle, struct inferior *inf); /* Finds the first thread of the specified inferior. */ -extern thread_info *first_thread_of_inferior (inferior *inf); +extern struct thread_info *first_thread_of_inferior (inferior *inf); /* Returns any thread of inferior INF, giving preference to the current thread. */ -extern thread_info *any_thread_of_inferior (inferior *inf); +extern struct thread_info *any_thread_of_inferior (inferior *inf); /* Returns any non-exited thread of inferior INF, giving preference to the current thread, and to not executing threads. */ -extern thread_info *any_live_thread_of_inferior (inferior *inf); +extern struct thread_info *any_live_thread_of_inferior (inferior *inf); /* Change the ptid of thread OLD_PTID to NEW_PTID. */ void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid); @@ -493,7 +493,7 @@ extern struct thread_info *iterate_over_threads (thread_callback_func, void *); extern int thread_count (void); /* Switch context to thread THR. Also sets the STOP_PC global. */ -extern void switch_to_thread (thread_info *thr); +extern void switch_to_thread (struct thread_info *thr); /* Switch context to no thread selected. */ extern void switch_to_no_thread (); @@ -660,7 +660,7 @@ class enable_thread_stack_temporaries { public: - explicit enable_thread_stack_temporaries (thread_info *thr) + explicit enable_thread_stack_temporaries (struct thread_info *thr) : m_thr (thr) { gdb_assert (m_thr != NULL); @@ -683,17 +683,17 @@ public: private: - thread_info *m_thr; + struct thread_info *m_thr; }; -extern bool thread_stack_temporaries_enabled_p (thread_info *tp); +extern bool thread_stack_temporaries_enabled_p (struct thread_info *tp); -extern void push_thread_stack_temporary (thread_info *tp, struct value *v); +extern void push_thread_stack_temporary (struct thread_info *tp, struct value *v); -extern value *get_last_thread_stack_temporary (thread_info *tp); +extern value *get_last_thread_stack_temporary (struct thread_info *tp); extern bool value_in_thread_stack_temporaries (struct value *, - thread_info *thr); + struct thread_info *thr); /* Add TP to the end of its inferior's pending step-over chain. */ @@ -723,7 +723,7 @@ extern void validate_registers_access (void); /* Check whether it makes sense to access a register of THREAD at this point. Returns true if registers may be accessed; false otherwise. */ -extern bool can_access_registers_thread (thread_info *thread); +extern bool can_access_registers_thread (struct thread_info *thread); /* Returns whether to show which thread hit the breakpoint, received a signal, etc. and ended up causing a user-visible stop. This is diff --git a/gdb/inferior.h b/gdb/inferior.h index 3f4d7a50d60..bfad91d9f3e 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -177,7 +177,7 @@ extern void delete_longjmp_breakpoint_cleanup (void *arg); extern void detach_command (const char *, int); -extern void notice_new_inferior (thread_info *, int, int); +extern void notice_new_inferior (struct thread_info *, int, int); extern struct value *get_return_value (struct value *function, struct type *value_type);