public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug remote/27219] New: remote.c compilation failure on CentOS 7
@ 2021-01-20 16:39 joel.sherrill at oarcorp dot com
2021-01-21 1:41 ` [Bug remote/27219] " cvs-commit at gcc dot gnu.org
2021-01-21 1:44 ` simark at simark dot ca
0 siblings, 2 replies; 3+ messages in thread
From: joel.sherrill at oarcorp dot com @ 2021-01-20 16:39 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27219
Bug ID: 27219
Summary: remote.c compilation failure on CentOS 7
Product: gdb
Version: HEAD
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: remote
Assignee: unassigned at sourceware dot org
Reporter: joel.sherrill at oarcorp dot com
Target Milestone: ---
Created attachment 13140
--> https://sourceware.org/bugzilla/attachment.cgi?id=13140&action=edit
Patch to address naming conflict in remote.c
Per https://sourceware.org/pipermail/gdb-patches/2021-January/175167.html,
gdb/remote.c fails to compile on CentOS 7. The compilation error is because an
enum and method have the same name. Per a suggestion in the thread, I renamed
the method resume_state() to get_resume_start(). Hopefully the name is OK. I
just went with the most obvious choice to me. This is in the attached patch.
Here is the error as reported by Sebastian Huber:
there could be a problem with this "enum class" on CentOS 7.9:
../../sourceware-mirror-binutils-gdb-edf0f28/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;
^
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function
'void remote_thread_info::set_not_resumed()':
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1115:22: error:
'resume_state' is not a class, namespace, or enumeration
m_resume_state = resume_state::NOT_RESUMED;
^
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function
'void remote_thread_info::set_resumed_pending_vcont(bool, gdb_signal)':
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1121:22: error:
'resume_state' is not a class, namespace, or enumeration
m_resume_state = resume_state::RESUMED_PENDING_VCONT;
^
In file included from
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/gdb_string_view.h:49:0,
from
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/common-utils.h:46,
from
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/common-defs.h:125,
from
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/defs.h:28,
from
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:22:
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function
'const resumed_pending_vcont_info&
remote_thread_info::resumed_pending_vcont_info() const':
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1132:35: error:
'resume_state' is not a class, namespace, or enumeration
gdb_assert (m_resume_state == resume_state::RESUMED_PENDING_VCONT);
^
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/../gdbsupport/gdb_assert.h:35:13:
note: in definition of macro 'gdb_assert'
((void) ((expr) ? 0 :
\
^
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c: In member function
'void remote_thread_info::set_resumed()':
../../sourceware-mirror-binutils-gdb-edf0f28/gdb/remote.c:1140:22: error:
'resume_state' is not a class, namespace, or enumeration
m_resume_state = resume_state::RESUMED;
^
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug remote/27219] remote.c compilation failure on CentOS 7
2021-01-20 16:39 [Bug remote/27219] New: remote.c compilation failure on CentOS 7 joel.sherrill at oarcorp dot com
@ 2021-01-21 1:41 ` cvs-commit at gcc dot gnu.org
2021-01-21 1:44 ` simark at simark dot ca
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-21 1:41 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27219
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <simark@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a6c11cbb14cea4900a97f8cb20762fefec6fda54
commit a6c11cbb14cea4900a97f8cb20762fefec6fda54
Author: Joel Sherrill <joel@rtems.org>
Date: Wed Jan 20 20:38:57 2021 -0500
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) <resume_state>: Rename
to...
<get_resume_state>: ... this.
(remote_target::resume): Adjust.
(remote_target::commit_resume): Adjust.
(remote_target::select_thread_for_ambiguous_stop_reply): Adjust.
Change-Id: Ib86c877a4c75ee671d69c27ed06cb8f57bc087db
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug remote/27219] remote.c compilation failure on CentOS 7
2021-01-20 16:39 [Bug remote/27219] New: remote.c compilation failure on CentOS 7 joel.sherrill at oarcorp dot com
2021-01-21 1:41 ` [Bug remote/27219] " cvs-commit at gcc dot gnu.org
@ 2021-01-21 1:44 ` simark at simark dot ca
1 sibling, 0 replies; 3+ messages in thread
From: simark at simark dot ca @ 2021-01-21 1:44 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=27219
Simon Marchi <simark at simark dot ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
CC| |simark at simark dot ca
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Simon Marchi <simark at simark dot ca> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-21 1:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 16:39 [Bug remote/27219] New: remote.c compilation failure on CentOS 7 joel.sherrill at oarcorp dot com
2021-01-21 1:41 ` [Bug remote/27219] " cvs-commit at gcc dot gnu.org
2021-01-21 1:44 ` simark at simark dot ca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).