From: Joel Sherrill Date: Thu, 21 Jan 2021 01:38:57 +0000 (-0500) Subject: gdb/remote.c: address conflicting enum and method name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a6c11cbb14cea4900a97f8cb20762fefec6fda54;p=binutils-gdb.git gdb/remote.c: address conflicting enum and method name When building with gcc 4.8, we get: CXX remote.o cc1plus: warning: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++ [enabled by default] /home/smarchi/src/binutils-gdb/gdb/remote.c:1157:38: error: 'resume_state' is not a class, namespace, or enumeration enum resume_state m_resume_state = resume_state::NOT_RESUMED; ^ It looks like gcc 4.8 doesn't like that there is an enum class named resume_state as well as a method. Since it's an easy fix, rename the method to get_remote_state to avoid the clash. gdb/ChangeLog: PR gdb/27219 * remote.c (struct remote_thread_info) : Rename to... : ... this. (remote_target::resume): Adjust. (remote_target::commit_resume): Adjust. (remote_target::select_thread_for_ambiguous_stop_reply): Adjust. Change-Id: Ib86c877a4c75ee671d69c27ed06cb8f57bc087db --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b63d7a6d6ed..4c686a95eda 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2021-01-20 Joel Sherrill + + PR gdb/27219 + * remote.c (struct remote_thread_info) : Rename + to... + : ... this. + (remote_target::resume): Adjust. + (remote_target::commit_resume): Adjust. + (remote_target::select_thread_for_ambiguous_stop_reply): Adjust. + 2021-01-20 Sergio Durigan Junior Tom Tromey diff --git a/gdb/remote.c b/gdb/remote.c index b4c6fc21083..5daabf236b7 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1104,7 +1104,7 @@ struct remote_thread_info : public private_thread_info CORE_ADDR watch_data_address = 0; /* Get the thread's resume state. */ - enum resume_state resume_state () const + enum resume_state get_resume_state () const { return m_resume_state; } @@ -6393,7 +6393,7 @@ remote_target::resume (ptid_t ptid, int step, enum gdb_signal siggnal) /* We don't expect the core to ask to resume an already resumed (from its point of view) thread. */ - gdb_assert (remote_thr->resume_state () == resume_state::NOT_RESUMED); + gdb_assert (remote_thr->get_resume_state () == resume_state::NOT_RESUMED); remote_thr->set_resumed_pending_vcont (step, siggnal); return; @@ -6645,7 +6645,7 @@ remote_target::commit_resume () /* If a thread of a process is not meant to be resumed, then we can't wildcard that process. */ - if (priv->resume_state () == resume_state::NOT_RESUMED) + if (priv->get_resume_state () == resume_state::NOT_RESUMED) { get_remote_inferior (tp->inf)->may_wildcard_vcont = false; @@ -6677,7 +6677,7 @@ remote_target::commit_resume () /* If the thread was previously vCont-resumed, no need to send a specific action for it. If we didn't receive a resume request for it, don't send an action for it either. */ - if (remote_thr->resume_state () != resume_state::RESUMED_PENDING_VCONT) + if (remote_thr->get_resume_state () != resume_state::RESUMED_PENDING_VCONT) continue; gdb_assert (!thread_is_in_step_over_chain (tp)); @@ -7803,7 +7803,7 @@ remote_target::select_thread_for_ambiguous_stop_reply { remote_thread_info *remote_thr = get_remote_thread_info (thr); - if (remote_thr->resume_state () != resume_state::RESUMED) + if (remote_thr->get_resume_state () != resume_state::RESUMED) continue; if (first_resumed_thread == nullptr)