public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gdbsupport: rename source files to .cc
@ 2020-02-12 22:54 Simon Marchi
  2020-02-12 22:54 ` [PATCH 2/2] gdbserver: " Simon Marchi
  2020-02-13 14:05 ` [PATCH 1/2] gdbsupport: " Tom Tromey
  0 siblings, 2 replies; 12+ messages in thread
From: Simon Marchi @ 2020-02-12 22:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

This patch renames the .c source files in gdbsupport to .cc.

In the gdb directory, there is an argument against renaming the source
files, which is that it makes using some git commands more difficult to
do archeology.  Some commands have some kind of "follow" option that
makes git try to follow renames, but it doesn't work in all situations.

Given that we have just moved the gdbsupport directory, that argument
doesn't hold for source files in that directory.  I therefore suggest
renaming them to .cc, so that they are automatically recognized as C++
by various tools and editors.

The original motivation behind this is that when building gdbsupport
with clang, I get:

      CC       agent.o
    clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated]

In the gdb/ directory, we make clang happy by passing "-x c++".  We
could do this in gdbsupport too, but I think that renaming the files is
a better long-term solution.

gdbserver still does its own build of gdbsupport, so a few changes in
its Makefile are necessary.

gdbsupport/ChangeLog:

	* Makefile.am: Rename source files from .c to .cc.
	* Makefile.in: Re-generate.
	* %.c: Rename to %.cc.

gdbserver/ChangeLog:

	* Makefile.in: Rename gdbsupport source files from .c to .cc.
---
 gdbserver/Makefile.in                         |  56 ++++----
 gdbsupport/Makefile.am                        |  68 +++++-----
 gdbsupport/Makefile.in                        | 121 +++++++++---------
 gdbsupport/{agent.c => agent.cc}              |   0
 .../{btrace-common.c => btrace-common.cc}     |   0
 gdbsupport/{buffer.c => buffer.cc}            |   0
 gdbsupport/{cleanups.c => cleanups.cc}        |   0
 .../{common-debug.c => common-debug.cc}       |   0
 ...mmon-exceptions.c => common-exceptions.cc} |   0
 .../{common-inferior.c => common-inferior.cc} |   0
 .../{common-regcache.c => common-regcache.cc} |   0
 .../{common-utils.c => common-utils.cc}       |   0
 gdbsupport/{environ.c => environ.cc}          |   0
 gdbsupport/{errors.c => errors.cc}            |   0
 gdbsupport/{fileio.c => fileio.cc}            |   0
 gdbsupport/{filestuff.c => filestuff.cc}      |   0
 gdbsupport/{format.c => format.cc}            |   0
 gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc}      |   0
 ...gdb_tilde_expand.c => gdb_tilde_expand.cc} |   0
 gdbsupport/{gdb_vecs.c => gdb_vecs.cc}        |   0
 gdbsupport/{gdb_wait.c => gdb_wait.cc}        |   0
 gdbsupport/{job-control.c => job-control.cc}  |   0
 gdbsupport/{netstuff.c => netstuff.cc}        |   0
 gdbsupport/{new-op.c => new-op.cc}            |   0
 gdbsupport/{pathstuff.c => pathstuff.cc}      |   0
 gdbsupport/{print-utils.c => print-utils.cc}  |   0
 gdbsupport/{ptid.c => ptid.cc}                |   0
 gdbsupport/{rsp-low.c => rsp-low.cc}          |   0
 .../{run-time-clock.c => run-time-clock.cc}   |   0
 .../{safe-strerror.c => safe-strerror.cc}     |   0
 gdbsupport/{scoped_mmap.c => scoped_mmap.cc}  |   0
 gdbsupport/{selftest.c => selftest.cc}        |   0
 ...estore.c => signals-state-save-restore.cc} |   0
 gdbsupport/{signals.c => signals.cc}          |   0
 gdbsupport/{tdesc.c => tdesc.cc}              |   0
 gdbsupport/{thread-pool.c => thread-pool.cc}  |   0
 gdbsupport/{xml-utils.c => xml-utils.cc}      |   0
 37 files changed, 123 insertions(+), 122 deletions(-)
 rename gdbsupport/{agent.c => agent.cc} (100%)
 rename gdbsupport/{btrace-common.c => btrace-common.cc} (100%)
 rename gdbsupport/{buffer.c => buffer.cc} (100%)
 rename gdbsupport/{cleanups.c => cleanups.cc} (100%)
 rename gdbsupport/{common-debug.c => common-debug.cc} (100%)
 rename gdbsupport/{common-exceptions.c => common-exceptions.cc} (100%)
 rename gdbsupport/{common-inferior.c => common-inferior.cc} (100%)
 rename gdbsupport/{common-regcache.c => common-regcache.cc} (100%)
 rename gdbsupport/{common-utils.c => common-utils.cc} (100%)
 rename gdbsupport/{environ.c => environ.cc} (100%)
 rename gdbsupport/{errors.c => errors.cc} (100%)
 rename gdbsupport/{fileio.c => fileio.cc} (100%)
 rename gdbsupport/{filestuff.c => filestuff.cc} (100%)
 rename gdbsupport/{format.c => format.cc} (100%)
 rename gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc} (100%)
 rename gdbsupport/{gdb_tilde_expand.c => gdb_tilde_expand.cc} (100%)
 rename gdbsupport/{gdb_vecs.c => gdb_vecs.cc} (100%)
 rename gdbsupport/{gdb_wait.c => gdb_wait.cc} (100%)
 rename gdbsupport/{job-control.c => job-control.cc} (100%)
 rename gdbsupport/{netstuff.c => netstuff.cc} (100%)
 rename gdbsupport/{new-op.c => new-op.cc} (100%)
 rename gdbsupport/{pathstuff.c => pathstuff.cc} (100%)
 rename gdbsupport/{print-utils.c => print-utils.cc} (100%)
 rename gdbsupport/{ptid.c => ptid.cc} (100%)
 rename gdbsupport/{rsp-low.c => rsp-low.cc} (100%)
 rename gdbsupport/{run-time-clock.c => run-time-clock.cc} (100%)
 rename gdbsupport/{safe-strerror.c => safe-strerror.cc} (100%)
 rename gdbsupport/{scoped_mmap.c => scoped_mmap.cc} (100%)
 rename gdbsupport/{selftest.c => selftest.cc} (100%)
 rename gdbsupport/{signals-state-save-restore.c => signals-state-save-restore.cc} (100%)
 rename gdbsupport/{signals.c => signals.cc} (100%)
 rename gdbsupport/{tdesc.c => tdesc.cc} (100%)
 rename gdbsupport/{thread-pool.c => thread-pool.cc} (100%)
 rename gdbsupport/{xml-utils.c => xml-utils.cc} (100%)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 60a52d3412b9..d912a0babef9 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -207,32 +207,32 @@ SFILES = \
 	$(srcdir)/../gdb/arch/arm-get-next-pcs.c \
 	$(srcdir)/../gdb/arch/arm-linux.c \
 	$(srcdir)/../gdb/arch/ppc-linux-common.c \
-	$(srcdir)/../gdbsupport/btrace-common.c \
-	$(srcdir)/../gdbsupport/buffer.c \
-	$(srcdir)/../gdbsupport/cleanups.c \
-	$(srcdir)/../gdbsupport/common-debug.c \
-	$(srcdir)/../gdbsupport/common-exceptions.c \
-	$(srcdir)/../gdbsupport/common-inferior.c \
-	$(srcdir)/../gdbsupport/common-regcache.c \
-	$(srcdir)/../gdbsupport/common-utils.c \
-	$(srcdir)/../gdbsupport/errors.c \
-	$(srcdir)/../gdbsupport/environ.c \
-	$(srcdir)/../gdbsupport/fileio.c \
-	$(srcdir)/../gdbsupport/filestuff.c \
-	$(srcdir)/../gdbsupport/job-control.c \
-	$(srcdir)/../gdbsupport/gdb-dlfcn.c \
-	$(srcdir)/../gdbsupport/gdb_tilde_expand.c \
-	$(srcdir)/../gdbsupport/gdb_vecs.c \
-	$(srcdir)/../gdbsupport/gdb_wait.c \
-	$(srcdir)/../gdbsupport/netstuff.c \
-	$(srcdir)/../gdbsupport/new-op.c \
-	$(srcdir)/../gdbsupport/pathstuff.c \
-	$(srcdir)/../gdbsupport/print-utils.c \
-	$(srcdir)/../gdbsupport/ptid.c \
-	$(srcdir)/../gdbsupport/rsp-low.c \
-	$(srcdir)/../gdbsupport/safe-strerror.c \
-	$(srcdir)/../gdbsupport/tdesc.c \
-	$(srcdir)/../gdbsupport/xml-utils.c \
+	$(srcdir)/../gdbsupport/btrace-common.cc \
+	$(srcdir)/../gdbsupport/buffer.cc \
+	$(srcdir)/../gdbsupport/cleanups.cc \
+	$(srcdir)/../gdbsupport/common-debug.cc \
+	$(srcdir)/../gdbsupport/common-exceptions.cc \
+	$(srcdir)/../gdbsupport/common-inferior.cc \
+	$(srcdir)/../gdbsupport/common-regcache.cc \
+	$(srcdir)/../gdbsupport/common-utils.cc \
+	$(srcdir)/../gdbsupport/errors.cc \
+	$(srcdir)/../gdbsupport/environ.cc \
+	$(srcdir)/../gdbsupport/fileio.cc \
+	$(srcdir)/../gdbsupport/filestuff.cc \
+	$(srcdir)/../gdbsupport/job-control.cc \
+	$(srcdir)/../gdbsupport/gdb-dlfcn.cc \
+	$(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
+	$(srcdir)/../gdbsupport/gdb_vecs.cc \
+	$(srcdir)/../gdbsupport/gdb_wait.cc \
+	$(srcdir)/../gdbsupport/netstuff.cc \
+	$(srcdir)/../gdbsupport/new-op.cc \
+	$(srcdir)/../gdbsupport/pathstuff.cc \
+	$(srcdir)/../gdbsupport/print-utils.cc \
+	$(srcdir)/../gdbsupport/ptid.cc \
+	$(srcdir)/../gdbsupport/rsp-low.cc \
+	$(srcdir)/../gdbsupport/safe-strerror.cc \
+	$(srcdir)/../gdbsupport/tdesc.cc \
+	$(srcdir)/../gdbsupport/xml-utils.cc \
 	$(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
 	$(srcdir)/../gdb/nat/linux-btrace.c \
 	$(srcdir)/../gdb/nat/linux-namespaces.c \
@@ -600,7 +600,7 @@ arch/%-ipa.o: ../gdb/arch/%.c
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
-gdbsupport/%-ipa.o: ../gdbsupport/%.c
+gdbsupport/%-ipa.o: ../gdbsupport/%.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
@@ -633,7 +633,7 @@ arch/%.o: ../gdb/arch/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-gdbsupport/%.o: ../gdbsupport/%.c
+gdbsupport/%.o: ../gdbsupport/%.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index cd7b0adf6b4c..f9f809505b5f 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -34,43 +34,43 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 noinst_LIBRARIES = libgdbsupport.a
 
 if SELFTEST
-selftest = selftest.c
+selftest = selftest.cc
 endif
 
 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)
 
 # Double-check that no defines are missing from our configury.
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index be4d53545311..3942f31424a8 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -177,18 +177,19 @@ DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 = 
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 = 
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 = 
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 = 
 SOURCES = $(libgdbsupport_a_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -355,48 +356,48 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
 
 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 noinst_LIBRARIES = libgdbsupport.a
-@SELFTEST_TRUE@selftest = selftest.c
+@SELFTEST_TRUE@selftest = selftest.cc
 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)
 
 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .cc .o .obj
 am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
@@ -495,19 +496,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-pool.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml-utils.Po@am__quote@
 
-.c.o:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+.cc.o:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
diff --git a/gdbsupport/agent.c b/gdbsupport/agent.cc
similarity index 100%
rename from gdbsupport/agent.c
rename to gdbsupport/agent.cc
diff --git a/gdbsupport/btrace-common.c b/gdbsupport/btrace-common.cc
similarity index 100%
rename from gdbsupport/btrace-common.c
rename to gdbsupport/btrace-common.cc
diff --git a/gdbsupport/buffer.c b/gdbsupport/buffer.cc
similarity index 100%
rename from gdbsupport/buffer.c
rename to gdbsupport/buffer.cc
diff --git a/gdbsupport/cleanups.c b/gdbsupport/cleanups.cc
similarity index 100%
rename from gdbsupport/cleanups.c
rename to gdbsupport/cleanups.cc
diff --git a/gdbsupport/common-debug.c b/gdbsupport/common-debug.cc
similarity index 100%
rename from gdbsupport/common-debug.c
rename to gdbsupport/common-debug.cc
diff --git a/gdbsupport/common-exceptions.c b/gdbsupport/common-exceptions.cc
similarity index 100%
rename from gdbsupport/common-exceptions.c
rename to gdbsupport/common-exceptions.cc
diff --git a/gdbsupport/common-inferior.c b/gdbsupport/common-inferior.cc
similarity index 100%
rename from gdbsupport/common-inferior.c
rename to gdbsupport/common-inferior.cc
diff --git a/gdbsupport/common-regcache.c b/gdbsupport/common-regcache.cc
similarity index 100%
rename from gdbsupport/common-regcache.c
rename to gdbsupport/common-regcache.cc
diff --git a/gdbsupport/common-utils.c b/gdbsupport/common-utils.cc
similarity index 100%
rename from gdbsupport/common-utils.c
rename to gdbsupport/common-utils.cc
diff --git a/gdbsupport/environ.c b/gdbsupport/environ.cc
similarity index 100%
rename from gdbsupport/environ.c
rename to gdbsupport/environ.cc
diff --git a/gdbsupport/errors.c b/gdbsupport/errors.cc
similarity index 100%
rename from gdbsupport/errors.c
rename to gdbsupport/errors.cc
diff --git a/gdbsupport/fileio.c b/gdbsupport/fileio.cc
similarity index 100%
rename from gdbsupport/fileio.c
rename to gdbsupport/fileio.cc
diff --git a/gdbsupport/filestuff.c b/gdbsupport/filestuff.cc
similarity index 100%
rename from gdbsupport/filestuff.c
rename to gdbsupport/filestuff.cc
diff --git a/gdbsupport/format.c b/gdbsupport/format.cc
similarity index 100%
rename from gdbsupport/format.c
rename to gdbsupport/format.cc
diff --git a/gdbsupport/gdb-dlfcn.c b/gdbsupport/gdb-dlfcn.cc
similarity index 100%
rename from gdbsupport/gdb-dlfcn.c
rename to gdbsupport/gdb-dlfcn.cc
diff --git a/gdbsupport/gdb_tilde_expand.c b/gdbsupport/gdb_tilde_expand.cc
similarity index 100%
rename from gdbsupport/gdb_tilde_expand.c
rename to gdbsupport/gdb_tilde_expand.cc
diff --git a/gdbsupport/gdb_vecs.c b/gdbsupport/gdb_vecs.cc
similarity index 100%
rename from gdbsupport/gdb_vecs.c
rename to gdbsupport/gdb_vecs.cc
diff --git a/gdbsupport/gdb_wait.c b/gdbsupport/gdb_wait.cc
similarity index 100%
rename from gdbsupport/gdb_wait.c
rename to gdbsupport/gdb_wait.cc
diff --git a/gdbsupport/job-control.c b/gdbsupport/job-control.cc
similarity index 100%
rename from gdbsupport/job-control.c
rename to gdbsupport/job-control.cc
diff --git a/gdbsupport/netstuff.c b/gdbsupport/netstuff.cc
similarity index 100%
rename from gdbsupport/netstuff.c
rename to gdbsupport/netstuff.cc
diff --git a/gdbsupport/new-op.c b/gdbsupport/new-op.cc
similarity index 100%
rename from gdbsupport/new-op.c
rename to gdbsupport/new-op.cc
diff --git a/gdbsupport/pathstuff.c b/gdbsupport/pathstuff.cc
similarity index 100%
rename from gdbsupport/pathstuff.c
rename to gdbsupport/pathstuff.cc
diff --git a/gdbsupport/print-utils.c b/gdbsupport/print-utils.cc
similarity index 100%
rename from gdbsupport/print-utils.c
rename to gdbsupport/print-utils.cc
diff --git a/gdbsupport/ptid.c b/gdbsupport/ptid.cc
similarity index 100%
rename from gdbsupport/ptid.c
rename to gdbsupport/ptid.cc
diff --git a/gdbsupport/rsp-low.c b/gdbsupport/rsp-low.cc
similarity index 100%
rename from gdbsupport/rsp-low.c
rename to gdbsupport/rsp-low.cc
diff --git a/gdbsupport/run-time-clock.c b/gdbsupport/run-time-clock.cc
similarity index 100%
rename from gdbsupport/run-time-clock.c
rename to gdbsupport/run-time-clock.cc
diff --git a/gdbsupport/safe-strerror.c b/gdbsupport/safe-strerror.cc
similarity index 100%
rename from gdbsupport/safe-strerror.c
rename to gdbsupport/safe-strerror.cc
diff --git a/gdbsupport/scoped_mmap.c b/gdbsupport/scoped_mmap.cc
similarity index 100%
rename from gdbsupport/scoped_mmap.c
rename to gdbsupport/scoped_mmap.cc
diff --git a/gdbsupport/selftest.c b/gdbsupport/selftest.cc
similarity index 100%
rename from gdbsupport/selftest.c
rename to gdbsupport/selftest.cc
diff --git a/gdbsupport/signals-state-save-restore.c b/gdbsupport/signals-state-save-restore.cc
similarity index 100%
rename from gdbsupport/signals-state-save-restore.c
rename to gdbsupport/signals-state-save-restore.cc
diff --git a/gdbsupport/signals.c b/gdbsupport/signals.cc
similarity index 100%
rename from gdbsupport/signals.c
rename to gdbsupport/signals.cc
diff --git a/gdbsupport/tdesc.c b/gdbsupport/tdesc.cc
similarity index 100%
rename from gdbsupport/tdesc.c
rename to gdbsupport/tdesc.cc
diff --git a/gdbsupport/thread-pool.c b/gdbsupport/thread-pool.cc
similarity index 100%
rename from gdbsupport/thread-pool.c
rename to gdbsupport/thread-pool.cc
diff --git a/gdbsupport/xml-utils.c b/gdbsupport/xml-utils.cc
similarity index 100%
rename from gdbsupport/xml-utils.c
rename to gdbsupport/xml-utils.cc
-- 
2.25.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/2] gdbserver: rename source files to .cc
  2020-02-12 22:54 [PATCH 1/2] gdbsupport: rename source files to .cc Simon Marchi
@ 2020-02-12 22:54 ` Simon Marchi
  2020-02-13 14:05   ` Tom Tromey
  2020-02-13 14:05 ` [PATCH 1/2] gdbsupport: " Tom Tromey
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Marchi @ 2020-02-12 22:54 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

For the same reasons outlined in the previous patch, this patch renames
gdbserver source files to .cc.

I have moved the "-x c++" switch to only those rules that require it.

gdbserver/ChangeLog:

	* Makefile.in: Rename source files from .c to .cc.
	* %.c: Rename to %.cc.
	* configure.ac: Rename server.c to server.cc.
	* configure: Re-generate.
---
 gdbserver/Makefile.in                         | 132 +++++++++---------
 gdbserver/{ax.c => ax.cc}                     |   0
 gdbserver/configure                           |   2 +-
 gdbserver/configure.ac                        |   2 +-
 gdbserver/{debug.c => debug.cc}               |   0
 gdbserver/{dll.c => dll.cc}                   |   0
 gdbserver/{event-loop.c => event-loop.cc}     |   0
 gdbserver/{fork-child.c => fork-child.cc}     |   0
 gdbserver/{gdbreplay.c => gdbreplay.cc}       |   0
 gdbserver/{hostio-errno.c => hostio-errno.cc} |   0
 gdbserver/{hostio.c => hostio.cc}             |   0
 gdbserver/{i387-fp.c => i387-fp.cc}           |   0
 gdbserver/{inferiors.c => inferiors.cc}       |   0
 ...nux-aarch32-low.c => linux-aarch32-low.cc} |   0
 ...aarch32-tdesc.c => linux-aarch32-tdesc.cc} |   0
 ...nux-aarch64-ipa.c => linux-aarch64-ipa.cc} |   0
 ...nux-aarch64-low.c => linux-aarch64-low.cc} |   0
 ...aarch64-tdesc.c => linux-aarch64-tdesc.cc} |   0
 .../{linux-amd64-ipa.c => linux-amd64-ipa.cc} |   0
 .../{linux-arm-low.c => linux-arm-low.cc}     |   0
 .../{linux-arm-tdesc.c => linux-arm-tdesc.cc} |   0
 .../{linux-bfin-low.c => linux-bfin-low.cc}   |   0
 .../{linux-cris-low.c => linux-cris-low.cc}   |   0
 ...nux-crisv32-low.c => linux-crisv32-low.cc} |   0
 .../{linux-i386-ipa.c => linux-i386-ipa.cc}   |   0
 .../{linux-ia64-low.c => linux-ia64-low.cc}   |   0
 gdbserver/{linux-low.c => linux-low.cc}       |   0
 .../{linux-m32r-low.c => linux-m32r-low.cc}   |   0
 .../{linux-m68k-low.c => linux-m68k-low.cc}   |   0
 .../{linux-mips-low.c => linux-mips-low.cc}   |   0
 .../{linux-nios2-low.c => linux-nios2-low.cc} |   0
 .../{linux-ppc-ipa.c => linux-ppc-ipa.cc}     |   0
 .../{linux-ppc-low.c => linux-ppc-low.cc}     |   0
 .../{linux-s390-ipa.c => linux-s390-ipa.cc}   |   0
 .../{linux-s390-low.c => linux-s390-low.cc}   |   0
 gdbserver/{linux-sh-low.c => linux-sh-low.cc} |   0
 .../{linux-sparc-low.c => linux-sparc-low.cc} |   0
 .../{linux-tic6x-low.c => linux-tic6x-low.cc} |   0
 .../{linux-tile-low.c => linux-tile-low.cc}   |   0
 .../{linux-x86-low.c => linux-x86-low.cc}     |   0
 .../{linux-x86-tdesc.c => linux-x86-tdesc.cc} |   0
 ...linux-xtensa-low.c => linux-xtensa-low.cc} |   0
 .../{lynx-i386-low.c => lynx-i386-low.cc}     |   0
 gdbserver/{lynx-low.c => lynx-low.cc}         |   0
 gdbserver/{lynx-ppc-low.c => lynx-ppc-low.cc} |   0
 gdbserver/{mem-break.c => mem-break.cc}       |   0
 gdbserver/{notif.c => notif.cc}               |   0
 gdbserver/{nto-low.c => nto-low.cc}           |   0
 gdbserver/{nto-x86-low.c => nto-x86-low.cc}   |   0
 gdbserver/{proc-service.c => proc-service.cc} |   0
 gdbserver/{regcache.c => regcache.cc}         |   0
 gdbserver/{remote-utils.c => remote-utils.cc} |   0
 gdbserver/{server.c => server.cc}             |   0
 gdbserver/{symbol.c => symbol.cc}             |   0
 gdbserver/{target.c => target.cc}             |   0
 gdbserver/{tdesc.c => tdesc.cc}               |   0
 gdbserver/{thread-db.c => thread-db.cc}       |   0
 gdbserver/{tracepoint.c => tracepoint.cc}     |   0
 gdbserver/{utils.c => utils.cc}               |   0
 .../{win32-arm-low.c => win32-arm-low.cc}     |   0
 .../{win32-i386-low.c => win32-i386-low.cc}   |   0
 gdbserver/{win32-low.c => win32-low.cc}       |   0
 gdbserver/{wincecompat.c => wincecompat.cc}   |   0
 gdbserver/{x86-low.c => x86-low.cc}           |   0
 .../{xtensa-xtregs.c => xtensa-xtregs.cc}     |   0
 65 files changed, 68 insertions(+), 68 deletions(-)
 rename gdbserver/{ax.c => ax.cc} (100%)
 rename gdbserver/{debug.c => debug.cc} (100%)
 rename gdbserver/{dll.c => dll.cc} (100%)
 rename gdbserver/{event-loop.c => event-loop.cc} (100%)
 rename gdbserver/{fork-child.c => fork-child.cc} (100%)
 rename gdbserver/{gdbreplay.c => gdbreplay.cc} (100%)
 rename gdbserver/{hostio-errno.c => hostio-errno.cc} (100%)
 rename gdbserver/{hostio.c => hostio.cc} (100%)
 rename gdbserver/{i387-fp.c => i387-fp.cc} (100%)
 rename gdbserver/{inferiors.c => inferiors.cc} (100%)
 rename gdbserver/{linux-aarch32-low.c => linux-aarch32-low.cc} (100%)
 rename gdbserver/{linux-aarch32-tdesc.c => linux-aarch32-tdesc.cc} (100%)
 rename gdbserver/{linux-aarch64-ipa.c => linux-aarch64-ipa.cc} (100%)
 rename gdbserver/{linux-aarch64-low.c => linux-aarch64-low.cc} (100%)
 rename gdbserver/{linux-aarch64-tdesc.c => linux-aarch64-tdesc.cc} (100%)
 rename gdbserver/{linux-amd64-ipa.c => linux-amd64-ipa.cc} (100%)
 rename gdbserver/{linux-arm-low.c => linux-arm-low.cc} (100%)
 rename gdbserver/{linux-arm-tdesc.c => linux-arm-tdesc.cc} (100%)
 rename gdbserver/{linux-bfin-low.c => linux-bfin-low.cc} (100%)
 rename gdbserver/{linux-cris-low.c => linux-cris-low.cc} (100%)
 rename gdbserver/{linux-crisv32-low.c => linux-crisv32-low.cc} (100%)
 rename gdbserver/{linux-i386-ipa.c => linux-i386-ipa.cc} (100%)
 rename gdbserver/{linux-ia64-low.c => linux-ia64-low.cc} (100%)
 rename gdbserver/{linux-low.c => linux-low.cc} (100%)
 rename gdbserver/{linux-m32r-low.c => linux-m32r-low.cc} (100%)
 rename gdbserver/{linux-m68k-low.c => linux-m68k-low.cc} (100%)
 rename gdbserver/{linux-mips-low.c => linux-mips-low.cc} (100%)
 rename gdbserver/{linux-nios2-low.c => linux-nios2-low.cc} (100%)
 rename gdbserver/{linux-ppc-ipa.c => linux-ppc-ipa.cc} (100%)
 rename gdbserver/{linux-ppc-low.c => linux-ppc-low.cc} (100%)
 rename gdbserver/{linux-s390-ipa.c => linux-s390-ipa.cc} (100%)
 rename gdbserver/{linux-s390-low.c => linux-s390-low.cc} (100%)
 rename gdbserver/{linux-sh-low.c => linux-sh-low.cc} (100%)
 rename gdbserver/{linux-sparc-low.c => linux-sparc-low.cc} (100%)
 rename gdbserver/{linux-tic6x-low.c => linux-tic6x-low.cc} (100%)
 rename gdbserver/{linux-tile-low.c => linux-tile-low.cc} (100%)
 rename gdbserver/{linux-x86-low.c => linux-x86-low.cc} (100%)
 rename gdbserver/{linux-x86-tdesc.c => linux-x86-tdesc.cc} (100%)
 rename gdbserver/{linux-xtensa-low.c => linux-xtensa-low.cc} (100%)
 rename gdbserver/{lynx-i386-low.c => lynx-i386-low.cc} (100%)
 rename gdbserver/{lynx-low.c => lynx-low.cc} (100%)
 rename gdbserver/{lynx-ppc-low.c => lynx-ppc-low.cc} (100%)
 rename gdbserver/{mem-break.c => mem-break.cc} (100%)
 rename gdbserver/{notif.c => notif.cc} (100%)
 rename gdbserver/{nto-low.c => nto-low.cc} (100%)
 rename gdbserver/{nto-x86-low.c => nto-x86-low.cc} (100%)
 rename gdbserver/{proc-service.c => proc-service.cc} (100%)
 rename gdbserver/{regcache.c => regcache.cc} (100%)
 rename gdbserver/{remote-utils.c => remote-utils.cc} (100%)
 rename gdbserver/{server.c => server.cc} (100%)
 rename gdbserver/{symbol.c => symbol.cc} (100%)
 rename gdbserver/{target.c => target.cc} (100%)
 rename gdbserver/{tdesc.c => tdesc.cc} (100%)
 rename gdbserver/{thread-db.c => thread-db.cc} (100%)
 rename gdbserver/{tracepoint.c => tracepoint.cc} (100%)
 rename gdbserver/{utils.c => utils.cc} (100%)
 rename gdbserver/{win32-arm-low.c => win32-arm-low.cc} (100%)
 rename gdbserver/{win32-i386-low.c => win32-i386-low.cc} (100%)
 rename gdbserver/{win32-low.c => win32-low.cc} (100%)
 rename gdbserver/{wincecompat.c => wincecompat.cc} (100%)
 rename gdbserver/{x86-low.c => x86-low.cc} (100%)
 rename gdbserver/{xtensa-xtregs.c => xtensa-xtregs.cc} (100%)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index d912a0babef9..5d0d608e058a 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -79,7 +79,7 @@ include $(srcdir)/../gdb/silent-rules.mk
 
 # Note that these are overridden by GNU make-specific code below if
 # GNU make is used.  The overrides implement dependency tracking.
-COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
+COMPILE.pre = $(CXX) $(CXX_DIALECT)
 COMPILE.post = -c -o $@
 COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
 POSTCOMPILE = @true
@@ -162,46 +162,46 @@ INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
 # All source files that go into linking GDB remote server.
 
 SFILES = \
-	$(srcdir)/debug.c \
-	$(srcdir)/dll.c \
-	$(srcdir)/gdbreplay.c \
-	$(srcdir)/hostio.c \
-	$(srcdir)/hostio-errno.c \
-	$(srcdir)/i387-fp.c \
-	$(srcdir)/inferiors.c \
-	$(srcdir)/linux-aarch64-low.c \
-	$(srcdir)/linux-arm-low.c \
-	$(srcdir)/linux-bfin-low.c \
-	$(srcdir)/linux-cris-low.c \
-	$(srcdir)/linux-crisv32-low.c \
-	$(srcdir)/linux-ia64-low.c \
-	$(srcdir)/linux-low.c \
-	$(srcdir)/linux-m32r-low.c \
-	$(srcdir)/linux-m68k-low.c \
-	$(srcdir)/linux-mips-low.c \
-	$(srcdir)/linux-nios2-low.c \
-	$(srcdir)/linux-ppc-low.c \
-	$(srcdir)/linux-s390-low.c \
-	$(srcdir)/linux-sh-low.c \
-	$(srcdir)/linux-sparc-low.c \
-	$(srcdir)/linux-tile-low.c \
-	$(srcdir)/linux-x86-low.c \
-	$(srcdir)/linux-xtensa-low.c \
-	$(srcdir)/mem-break.c \
-	$(srcdir)/proc-service.c \
+	$(srcdir)/debug.cc \
+	$(srcdir)/dll.cc \
+	$(srcdir)/gdbreplay.cc \
+	$(srcdir)/hostio.cc \
+	$(srcdir)/hostio-errno.cc \
+	$(srcdir)/i387-fp.cc \
+	$(srcdir)/inferiors.cc \
+	$(srcdir)/linux-aarch64-low.cc \
+	$(srcdir)/linux-arm-low.cc \
+	$(srcdir)/linux-bfin-low.cc \
+	$(srcdir)/linux-cris-low.cc \
+	$(srcdir)/linux-crisv32-low.cc \
+	$(srcdir)/linux-ia64-low.cc \
+	$(srcdir)/linux-low.cc \
+	$(srcdir)/linux-m32r-low.cc \
+	$(srcdir)/linux-m68k-low.cc \
+	$(srcdir)/linux-mips-low.cc \
+	$(srcdir)/linux-nios2-low.cc \
+	$(srcdir)/linux-ppc-low.cc \
+	$(srcdir)/linux-s390-low.cc \
+	$(srcdir)/linux-sh-low.cc \
+	$(srcdir)/linux-sparc-low.cc \
+	$(srcdir)/linux-tile-low.cc \
+	$(srcdir)/linux-x86-low.cc \
+	$(srcdir)/linux-xtensa-low.cc \
+	$(srcdir)/mem-break.cc \
+	$(srcdir)/proc-service.cc \
 	$(srcdir)/proc-service.list \
-	$(srcdir)/regcache.c \
-	$(srcdir)/remote-utils.c \
-	$(srcdir)/server.c \
-	$(srcdir)/symbol.c \
-	$(srcdir)/target.c \
-	$(srcdir)/thread-db.c \
-	$(srcdir)/utils.c \
-	$(srcdir)/win32-arm-low.c \
-	$(srcdir)/win32-i386-low.c \
-	$(srcdir)/win32-low.c \
-	$(srcdir)/wincecompat.c \
-	$(srcdir)/x86-low.c \
+	$(srcdir)/regcache.cc \
+	$(srcdir)/remote-utils.cc \
+	$(srcdir)/server.cc \
+	$(srcdir)/symbol.cc \
+	$(srcdir)/target.cc \
+	$(srcdir)/thread-db.cc \
+	$(srcdir)/utils.cc \
+	$(srcdir)/win32-arm-low.cc \
+	$(srcdir)/win32-i386-low.cc \
+	$(srcdir)/win32-low.cc \
+	$(srcdir)/wincecompat.cc \
+	$(srcdir)/x86-low.cc \
 	$(srcdir)/../gdb/alloc.c \
 	$(srcdir)/../gdb/arch/arm.c \
 	$(srcdir)/../gdb/arch/arm-get-next-pcs.c \
@@ -469,7 +469,7 @@ TAGS:	${TAGFILES}
 	etags \
 	  `for i in yzzy ${DEPFILES}; do \
 	     if [ x$$i != xyzzy ]; then \
-	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' \
+	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
 		 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
 		 -e 's,/\(gdbsupport\)/,/../../\1/,'; \
 	     fi; \
@@ -481,7 +481,7 @@ clean:
 	rm -f *.o ${ADD_FILES} *~
 	rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
 	rm -f $(IPA_LIB)
-	rm -f *-generated.c
+	rm -f *-generated.cc
 	rm -f stamp-xml
 	rm -f $(DEPDIR)/*.Po
 	for i in $(CONFIG_SRC_SUBDIR); do \
@@ -541,19 +541,19 @@ am--refresh:
 
 force:
 
-version-generated.c: Makefile $(srcdir)/../gdb/version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
+version-generated.cc: Makefile $(srcdir)/../gdb/version.in $(srcdir)/../bfd/version.h $(srcdir)/../gdbsupport/create-version.sh
 	$(ECHO_GEN) $(SHELL) $(srcdir)/../gdbsupport/create-version.sh $(srcdir)/../gdb \
 		$(host_alias) $(target_alias) $@
 
-xml-builtin-generated.c: stamp-xml; @true
+xml-builtin-generated.cc: stamp-xml; @true
 stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
 	$(SILENCE) rm -f xml-builtin.tmp
 	$(ECHO_GEN_XML_BUILTIN_GENERATED) $(SHELL) $(XML_DIR)/feature_to_c.sh \
 		xml-builtin.tmp $(XML_FILES)
-	$(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin-generated.c
+	$(SILENCE) $(SHELL) $(srcdir)/../move-if-change xml-builtin.tmp xml-builtin-generated.cc
 	$(SILENCE) echo stamp > stamp-xml
 
-.PRECIOUS: xml-builtin.c
+.PRECIOUS: xml-builtin.cc
 
 # GNU Make has an annoying habit of putting *all* the Makefile variables
 # into the environment, unless you include this target as a circumvention.
@@ -586,87 +586,87 @@ IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
 
 # Rules for special cases.
 
-ax-ipa.o: ax.c
+ax-ipa.o: ax.cc
 	$(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
 	$(POSTCOMPILE)
 
-ax.o: ax.c
+ax.o: ax.cc
 	$(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $<
 	$(POSTCOMPILE)
 
 # Rules for objects that go in the in-process agent.
 
 arch/%-ipa.o: ../gdb/arch/%.c
-	$(IPAGENT_COMPILE) $<
+	$(IPAGENT_COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 gdbsupport/%-ipa.o: ../gdbsupport/%.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
-%-ipa.o: %-generated.c
+%-ipa.o: %-generated.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
-%-ipa.o: %.c
+%-ipa.o: %.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
 %-ipa.o: ../gdb/%.c
-	$(IPAGENT_COMPILE) $<
+	$(IPAGENT_COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one.
-# Therefore, this one needs to be before "%.o: %.c" for it to be considered for
-# files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c.
+# Therefore, this one needs to be before "%.o: %.cc" for it to be considered for
+# files such as linux-amd64-ipa.o generated from linux-amd64-ipa.cc.
 #
 # Later versions of GNU Make choose the rule with the shortest stem, so it would
 # work in any order.
 
-%-ipa.o: %-ipa.c
+%-ipa.o: %-ipa.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)
 
 # Rules for objects that go in the gdbserver binary.
 
 arch/%.o: ../gdb/arch/%.c
-	$(COMPILE) $<
+	$(COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 gdbsupport/%.o: ../gdbsupport/%.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-%.o: %-generated.c
+%.o: %-generated.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
-%.o: %.c
+%.o: %.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)
 
 nat/%.o: ../gdb/nat/%.c
-	$(COMPILE) $<
+	$(COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 target/%.o: ../gdb/target/%.c
-	$(COMPILE) $<
+	$(COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 %.o: ../gdb/%.c
-	$(COMPILE) $<
+	$(COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
 # Rules for register format descriptions.  Suffix destination files with
 # -generated to identify and clean them easily.
 
-%-generated.c: ../gdb/regformats/%.dat $(regdat_sh)
+%-generated.cc: ../gdb/regformats/%.dat $(regdat_sh)
 	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
-%-generated.c: ../gdb/regformats/arm/%.dat $(regdat_sh)
+%-generated.cc: ../gdb/regformats/arm/%.dat $(regdat_sh)
 	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
-%-generated.c: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
+%-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
 	$(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
 #
@@ -684,7 +684,7 @@ override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
 else
 override COMPILE.pre = source='$<' object='$@' libtool=no \
 	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
-	$(CXX) -x c++ $(CXX_DIALECT)
+	$(CXX) $(CXX_DIALECT)
 # depcomp handles atomicity for us, so we don't need a postcompile
 # step.
 override POSTCOMPILE =
@@ -713,7 +713,7 @@ all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
 # Disable implicit make rules.
 include $(srcdir)/../gdb/disable-implicit-rules.mk
 
-# Do not delete intermediate files (e.g. *-generated.c).
+# Do not delete intermediate files (e.g. *-generated.cc).
 .SECONDARY:
 
 # This is the end of "Makefile.in".
diff --git a/gdbserver/ax.c b/gdbserver/ax.cc
similarity index 100%
rename from gdbserver/ax.c
rename to gdbserver/ax.cc
diff --git a/gdbserver/configure b/gdbserver/configure
index 71b515ec955a..7d42803f640d 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -582,7 +582,7 @@ PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 PACKAGE_URL=
 
-ac_unique_file="server.c"
+ac_unique_file="server.cc"
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 285a297a1c6c..0da2bfa95e46 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -18,7 +18,7 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(server.c)
+AC_INIT(server.cc)
 AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
 
 AM_MAINTAINER_MODE
diff --git a/gdbserver/debug.c b/gdbserver/debug.cc
similarity index 100%
rename from gdbserver/debug.c
rename to gdbserver/debug.cc
diff --git a/gdbserver/dll.c b/gdbserver/dll.cc
similarity index 100%
rename from gdbserver/dll.c
rename to gdbserver/dll.cc
diff --git a/gdbserver/event-loop.c b/gdbserver/event-loop.cc
similarity index 100%
rename from gdbserver/event-loop.c
rename to gdbserver/event-loop.cc
diff --git a/gdbserver/fork-child.c b/gdbserver/fork-child.cc
similarity index 100%
rename from gdbserver/fork-child.c
rename to gdbserver/fork-child.cc
diff --git a/gdbserver/gdbreplay.c b/gdbserver/gdbreplay.cc
similarity index 100%
rename from gdbserver/gdbreplay.c
rename to gdbserver/gdbreplay.cc
diff --git a/gdbserver/hostio-errno.c b/gdbserver/hostio-errno.cc
similarity index 100%
rename from gdbserver/hostio-errno.c
rename to gdbserver/hostio-errno.cc
diff --git a/gdbserver/hostio.c b/gdbserver/hostio.cc
similarity index 100%
rename from gdbserver/hostio.c
rename to gdbserver/hostio.cc
diff --git a/gdbserver/i387-fp.c b/gdbserver/i387-fp.cc
similarity index 100%
rename from gdbserver/i387-fp.c
rename to gdbserver/i387-fp.cc
diff --git a/gdbserver/inferiors.c b/gdbserver/inferiors.cc
similarity index 100%
rename from gdbserver/inferiors.c
rename to gdbserver/inferiors.cc
diff --git a/gdbserver/linux-aarch32-low.c b/gdbserver/linux-aarch32-low.cc
similarity index 100%
rename from gdbserver/linux-aarch32-low.c
rename to gdbserver/linux-aarch32-low.cc
diff --git a/gdbserver/linux-aarch32-tdesc.c b/gdbserver/linux-aarch32-tdesc.cc
similarity index 100%
rename from gdbserver/linux-aarch32-tdesc.c
rename to gdbserver/linux-aarch32-tdesc.cc
diff --git a/gdbserver/linux-aarch64-ipa.c b/gdbserver/linux-aarch64-ipa.cc
similarity index 100%
rename from gdbserver/linux-aarch64-ipa.c
rename to gdbserver/linux-aarch64-ipa.cc
diff --git a/gdbserver/linux-aarch64-low.c b/gdbserver/linux-aarch64-low.cc
similarity index 100%
rename from gdbserver/linux-aarch64-low.c
rename to gdbserver/linux-aarch64-low.cc
diff --git a/gdbserver/linux-aarch64-tdesc.c b/gdbserver/linux-aarch64-tdesc.cc
similarity index 100%
rename from gdbserver/linux-aarch64-tdesc.c
rename to gdbserver/linux-aarch64-tdesc.cc
diff --git a/gdbserver/linux-amd64-ipa.c b/gdbserver/linux-amd64-ipa.cc
similarity index 100%
rename from gdbserver/linux-amd64-ipa.c
rename to gdbserver/linux-amd64-ipa.cc
diff --git a/gdbserver/linux-arm-low.c b/gdbserver/linux-arm-low.cc
similarity index 100%
rename from gdbserver/linux-arm-low.c
rename to gdbserver/linux-arm-low.cc
diff --git a/gdbserver/linux-arm-tdesc.c b/gdbserver/linux-arm-tdesc.cc
similarity index 100%
rename from gdbserver/linux-arm-tdesc.c
rename to gdbserver/linux-arm-tdesc.cc
diff --git a/gdbserver/linux-bfin-low.c b/gdbserver/linux-bfin-low.cc
similarity index 100%
rename from gdbserver/linux-bfin-low.c
rename to gdbserver/linux-bfin-low.cc
diff --git a/gdbserver/linux-cris-low.c b/gdbserver/linux-cris-low.cc
similarity index 100%
rename from gdbserver/linux-cris-low.c
rename to gdbserver/linux-cris-low.cc
diff --git a/gdbserver/linux-crisv32-low.c b/gdbserver/linux-crisv32-low.cc
similarity index 100%
rename from gdbserver/linux-crisv32-low.c
rename to gdbserver/linux-crisv32-low.cc
diff --git a/gdbserver/linux-i386-ipa.c b/gdbserver/linux-i386-ipa.cc
similarity index 100%
rename from gdbserver/linux-i386-ipa.c
rename to gdbserver/linux-i386-ipa.cc
diff --git a/gdbserver/linux-ia64-low.c b/gdbserver/linux-ia64-low.cc
similarity index 100%
rename from gdbserver/linux-ia64-low.c
rename to gdbserver/linux-ia64-low.cc
diff --git a/gdbserver/linux-low.c b/gdbserver/linux-low.cc
similarity index 100%
rename from gdbserver/linux-low.c
rename to gdbserver/linux-low.cc
diff --git a/gdbserver/linux-m32r-low.c b/gdbserver/linux-m32r-low.cc
similarity index 100%
rename from gdbserver/linux-m32r-low.c
rename to gdbserver/linux-m32r-low.cc
diff --git a/gdbserver/linux-m68k-low.c b/gdbserver/linux-m68k-low.cc
similarity index 100%
rename from gdbserver/linux-m68k-low.c
rename to gdbserver/linux-m68k-low.cc
diff --git a/gdbserver/linux-mips-low.c b/gdbserver/linux-mips-low.cc
similarity index 100%
rename from gdbserver/linux-mips-low.c
rename to gdbserver/linux-mips-low.cc
diff --git a/gdbserver/linux-nios2-low.c b/gdbserver/linux-nios2-low.cc
similarity index 100%
rename from gdbserver/linux-nios2-low.c
rename to gdbserver/linux-nios2-low.cc
diff --git a/gdbserver/linux-ppc-ipa.c b/gdbserver/linux-ppc-ipa.cc
similarity index 100%
rename from gdbserver/linux-ppc-ipa.c
rename to gdbserver/linux-ppc-ipa.cc
diff --git a/gdbserver/linux-ppc-low.c b/gdbserver/linux-ppc-low.cc
similarity index 100%
rename from gdbserver/linux-ppc-low.c
rename to gdbserver/linux-ppc-low.cc
diff --git a/gdbserver/linux-s390-ipa.c b/gdbserver/linux-s390-ipa.cc
similarity index 100%
rename from gdbserver/linux-s390-ipa.c
rename to gdbserver/linux-s390-ipa.cc
diff --git a/gdbserver/linux-s390-low.c b/gdbserver/linux-s390-low.cc
similarity index 100%
rename from gdbserver/linux-s390-low.c
rename to gdbserver/linux-s390-low.cc
diff --git a/gdbserver/linux-sh-low.c b/gdbserver/linux-sh-low.cc
similarity index 100%
rename from gdbserver/linux-sh-low.c
rename to gdbserver/linux-sh-low.cc
diff --git a/gdbserver/linux-sparc-low.c b/gdbserver/linux-sparc-low.cc
similarity index 100%
rename from gdbserver/linux-sparc-low.c
rename to gdbserver/linux-sparc-low.cc
diff --git a/gdbserver/linux-tic6x-low.c b/gdbserver/linux-tic6x-low.cc
similarity index 100%
rename from gdbserver/linux-tic6x-low.c
rename to gdbserver/linux-tic6x-low.cc
diff --git a/gdbserver/linux-tile-low.c b/gdbserver/linux-tile-low.cc
similarity index 100%
rename from gdbserver/linux-tile-low.c
rename to gdbserver/linux-tile-low.cc
diff --git a/gdbserver/linux-x86-low.c b/gdbserver/linux-x86-low.cc
similarity index 100%
rename from gdbserver/linux-x86-low.c
rename to gdbserver/linux-x86-low.cc
diff --git a/gdbserver/linux-x86-tdesc.c b/gdbserver/linux-x86-tdesc.cc
similarity index 100%
rename from gdbserver/linux-x86-tdesc.c
rename to gdbserver/linux-x86-tdesc.cc
diff --git a/gdbserver/linux-xtensa-low.c b/gdbserver/linux-xtensa-low.cc
similarity index 100%
rename from gdbserver/linux-xtensa-low.c
rename to gdbserver/linux-xtensa-low.cc
diff --git a/gdbserver/lynx-i386-low.c b/gdbserver/lynx-i386-low.cc
similarity index 100%
rename from gdbserver/lynx-i386-low.c
rename to gdbserver/lynx-i386-low.cc
diff --git a/gdbserver/lynx-low.c b/gdbserver/lynx-low.cc
similarity index 100%
rename from gdbserver/lynx-low.c
rename to gdbserver/lynx-low.cc
diff --git a/gdbserver/lynx-ppc-low.c b/gdbserver/lynx-ppc-low.cc
similarity index 100%
rename from gdbserver/lynx-ppc-low.c
rename to gdbserver/lynx-ppc-low.cc
diff --git a/gdbserver/mem-break.c b/gdbserver/mem-break.cc
similarity index 100%
rename from gdbserver/mem-break.c
rename to gdbserver/mem-break.cc
diff --git a/gdbserver/notif.c b/gdbserver/notif.cc
similarity index 100%
rename from gdbserver/notif.c
rename to gdbserver/notif.cc
diff --git a/gdbserver/nto-low.c b/gdbserver/nto-low.cc
similarity index 100%
rename from gdbserver/nto-low.c
rename to gdbserver/nto-low.cc
diff --git a/gdbserver/nto-x86-low.c b/gdbserver/nto-x86-low.cc
similarity index 100%
rename from gdbserver/nto-x86-low.c
rename to gdbserver/nto-x86-low.cc
diff --git a/gdbserver/proc-service.c b/gdbserver/proc-service.cc
similarity index 100%
rename from gdbserver/proc-service.c
rename to gdbserver/proc-service.cc
diff --git a/gdbserver/regcache.c b/gdbserver/regcache.cc
similarity index 100%
rename from gdbserver/regcache.c
rename to gdbserver/regcache.cc
diff --git a/gdbserver/remote-utils.c b/gdbserver/remote-utils.cc
similarity index 100%
rename from gdbserver/remote-utils.c
rename to gdbserver/remote-utils.cc
diff --git a/gdbserver/server.c b/gdbserver/server.cc
similarity index 100%
rename from gdbserver/server.c
rename to gdbserver/server.cc
diff --git a/gdbserver/symbol.c b/gdbserver/symbol.cc
similarity index 100%
rename from gdbserver/symbol.c
rename to gdbserver/symbol.cc
diff --git a/gdbserver/target.c b/gdbserver/target.cc
similarity index 100%
rename from gdbserver/target.c
rename to gdbserver/target.cc
diff --git a/gdbserver/tdesc.c b/gdbserver/tdesc.cc
similarity index 100%
rename from gdbserver/tdesc.c
rename to gdbserver/tdesc.cc
diff --git a/gdbserver/thread-db.c b/gdbserver/thread-db.cc
similarity index 100%
rename from gdbserver/thread-db.c
rename to gdbserver/thread-db.cc
diff --git a/gdbserver/tracepoint.c b/gdbserver/tracepoint.cc
similarity index 100%
rename from gdbserver/tracepoint.c
rename to gdbserver/tracepoint.cc
diff --git a/gdbserver/utils.c b/gdbserver/utils.cc
similarity index 100%
rename from gdbserver/utils.c
rename to gdbserver/utils.cc
diff --git a/gdbserver/win32-arm-low.c b/gdbserver/win32-arm-low.cc
similarity index 100%
rename from gdbserver/win32-arm-low.c
rename to gdbserver/win32-arm-low.cc
diff --git a/gdbserver/win32-i386-low.c b/gdbserver/win32-i386-low.cc
similarity index 100%
rename from gdbserver/win32-i386-low.c
rename to gdbserver/win32-i386-low.cc
diff --git a/gdbserver/win32-low.c b/gdbserver/win32-low.cc
similarity index 100%
rename from gdbserver/win32-low.c
rename to gdbserver/win32-low.cc
diff --git a/gdbserver/wincecompat.c b/gdbserver/wincecompat.cc
similarity index 100%
rename from gdbserver/wincecompat.c
rename to gdbserver/wincecompat.cc
diff --git a/gdbserver/x86-low.c b/gdbserver/x86-low.cc
similarity index 100%
rename from gdbserver/x86-low.c
rename to gdbserver/x86-low.cc
diff --git a/gdbserver/xtensa-xtregs.c b/gdbserver/xtensa-xtregs.cc
similarity index 100%
rename from gdbserver/xtensa-xtregs.c
rename to gdbserver/xtensa-xtregs.cc
-- 
2.25.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-12 22:54 [PATCH 1/2] gdbsupport: rename source files to .cc Simon Marchi
  2020-02-12 22:54 ` [PATCH 2/2] gdbserver: " Simon Marchi
@ 2020-02-13 14:05 ` Tom Tromey
  2020-02-13 14:41   ` Simon Marchi
  2020-02-13 18:34   ` Pedro Alves
  1 sibling, 2 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-13 14:05 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> This patch renames the .c source files in gdbsupport to .cc.

I support this change.

Note that this would let us remove these hacks from gdbsupport/Makefile.am:

override CXX += $(CXX_DIALECT)

override CC := $(CXX)
override CFLAGS := $(CXXFLAGS)

AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)


The CC and CFLAGS settings can be removed entirely.  AM_CFLAGS can be
renamed to AM_CXXFLAGS, and the CXX_DIALECT can be put there.

thanks,
Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdbserver: rename source files to .cc
  2020-02-12 22:54 ` [PATCH 2/2] gdbserver: " Simon Marchi
@ 2020-02-13 14:05   ` Tom Tromey
  2020-02-13 14:48     ` Simon Marchi
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2020-02-13 14:05 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> For the same reasons outlined in the previous patch, this patch renames
Simon> gdbserver source files to .cc.

I support this as well, but I wonder if it would be easier for Tankut if
we held off landing this patch until his big target_ops series goes in.

Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-13 14:05 ` [PATCH 1/2] gdbsupport: " Tom Tromey
@ 2020-02-13 14:41   ` Simon Marchi
  2020-02-13 18:34   ` Pedro Alves
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Marchi @ 2020-02-13 14:41 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2020-02-13 9:04 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> This patch renames the .c source files in gdbsupport to .cc.
> 
> I support this change.
> 
> Note that this would let us remove these hacks from gdbsupport/Makefile.am:
> 
> override CXX += $(CXX_DIALECT)
> 
> override CC := $(CXX)
> override CFLAGS := $(CXXFLAGS)
> 
> AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
> 
> 
> The CC and CFLAGS settings can be removed entirely.  AM_CFLAGS can be
> renamed to AM_CXXFLAGS, and the CXX_DIALECT can be put there.
> 
> thanks,
> Tom
> 

Of course, here's the revised patch.

Actually, the AM_CFLAGS -> AM_CXXFLAGS change is necessary, otherwise the warning
flags are not applied at all.


From 9e024473dd550a7d272c68d94e8d859be830768d Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>
Date: Wed, 12 Feb 2020 16:10:10 -0500
Subject: [PATCH] gdbsupport: rename source files to .cc

This patch renames the .c source files in gdbsupport to .cc.

In the gdb directory, there is an argument against renaming the source
files, which is that it makes using some git commands more difficult to
do archeology.  Some commands have some kind of "follow" option that
makes git try to follow renames, but it doesn't work in all situations.

Given that we have just moved the gdbsupport directory, that argument
doesn't hold for source files in that directory.  I therefore suggest
renaming them to .cc, so that they are automatically recognized as C++
by various tools and editors.

The original motivation behind this is that when building gdbsupport
with clang, I get:

      CC       agent.o
    clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated]

In the gdb/ directory, we make clang happy by passing "-x c++".  We
could do this in gdbsupport too, but I think that renaming the files is
a better long-term solution.

gdbserver still does its own build of gdbsupport, so a few changes in
its Makefile are necessary.

gdbsupport/ChangeLog:

	* Makefile.am: Rename source files from .c to .cc.
	* Makefile.in: Re-generate.
	* %.c: Rename to %.cc.

gdbserver/ChangeLog:

	* Makefile.in: Rename gdbsupport source files from .c to .cc.
---
 gdbserver/Makefile.in                         |  56 ++++----
 gdbsupport/Makefile.am                        |  75 +++++------
 gdbsupport/Makefile.in                        | 126 +++++++++---------
 gdbsupport/{agent.c => agent.cc}              |   0
 .../{btrace-common.c => btrace-common.cc}     |   0
 gdbsupport/{buffer.c => buffer.cc}            |   0
 gdbsupport/{cleanups.c => cleanups.cc}        |   0
 .../{common-debug.c => common-debug.cc}       |   0
 ...mmon-exceptions.c => common-exceptions.cc} |   0
 .../{common-inferior.c => common-inferior.cc} |   0
 .../{common-regcache.c => common-regcache.cc} |   0
 .../{common-utils.c => common-utils.cc}       |   0
 gdbsupport/{environ.c => environ.cc}          |   0
 gdbsupport/{errors.c => errors.cc}            |   0
 gdbsupport/{fileio.c => fileio.cc}            |   0
 gdbsupport/{filestuff.c => filestuff.cc}      |   0
 gdbsupport/{format.c => format.cc}            |   0
 gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc}      |   0
 ...gdb_tilde_expand.c => gdb_tilde_expand.cc} |   0
 gdbsupport/{gdb_vecs.c => gdb_vecs.cc}        |   0
 gdbsupport/{gdb_wait.c => gdb_wait.cc}        |   0
 gdbsupport/{job-control.c => job-control.cc}  |   0
 gdbsupport/{netstuff.c => netstuff.cc}        |   0
 gdbsupport/{new-op.c => new-op.cc}            |   0
 gdbsupport/{pathstuff.c => pathstuff.cc}      |   0
 gdbsupport/{print-utils.c => print-utils.cc}  |   0
 gdbsupport/{ptid.c => ptid.cc}                |   0
 gdbsupport/{rsp-low.c => rsp-low.cc}          |   0
 .../{run-time-clock.c => run-time-clock.cc}   |   0
 .../{safe-strerror.c => safe-strerror.cc}     |   0
 gdbsupport/{scoped_mmap.c => scoped_mmap.cc}  |   0
 gdbsupport/{selftest.c => selftest.cc}        |   0
 ...estore.c => signals-state-save-restore.cc} |   0
 gdbsupport/{signals.c => signals.cc}          |   0
 gdbsupport/{tdesc.c => tdesc.cc}              |   0
 gdbsupport/{thread-pool.c => thread-pool.cc}  |   0
 gdbsupport/{xml-utils.c => xml-utils.cc}      |   0
 37 files changed, 124 insertions(+), 133 deletions(-)
 rename gdbsupport/{agent.c => agent.cc} (100%)
 rename gdbsupport/{btrace-common.c => btrace-common.cc} (100%)
 rename gdbsupport/{buffer.c => buffer.cc} (100%)
 rename gdbsupport/{cleanups.c => cleanups.cc} (100%)
 rename gdbsupport/{common-debug.c => common-debug.cc} (100%)
 rename gdbsupport/{common-exceptions.c => common-exceptions.cc} (100%)
 rename gdbsupport/{common-inferior.c => common-inferior.cc} (100%)
 rename gdbsupport/{common-regcache.c => common-regcache.cc} (100%)
 rename gdbsupport/{common-utils.c => common-utils.cc} (100%)
 rename gdbsupport/{environ.c => environ.cc} (100%)
 rename gdbsupport/{errors.c => errors.cc} (100%)
 rename gdbsupport/{fileio.c => fileio.cc} (100%)
 rename gdbsupport/{filestuff.c => filestuff.cc} (100%)
 rename gdbsupport/{format.c => format.cc} (100%)
 rename gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc} (100%)
 rename gdbsupport/{gdb_tilde_expand.c => gdb_tilde_expand.cc} (100%)
 rename gdbsupport/{gdb_vecs.c => gdb_vecs.cc} (100%)
 rename gdbsupport/{gdb_wait.c => gdb_wait.cc} (100%)
 rename gdbsupport/{job-control.c => job-control.cc} (100%)
 rename gdbsupport/{netstuff.c => netstuff.cc} (100%)
 rename gdbsupport/{new-op.c => new-op.cc} (100%)
 rename gdbsupport/{pathstuff.c => pathstuff.cc} (100%)
 rename gdbsupport/{print-utils.c => print-utils.cc} (100%)
 rename gdbsupport/{ptid.c => ptid.cc} (100%)
 rename gdbsupport/{rsp-low.c => rsp-low.cc} (100%)
 rename gdbsupport/{run-time-clock.c => run-time-clock.cc} (100%)
 rename gdbsupport/{safe-strerror.c => safe-strerror.cc} (100%)
 rename gdbsupport/{scoped_mmap.c => scoped_mmap.cc} (100%)
 rename gdbsupport/{selftest.c => selftest.cc} (100%)
 rename gdbsupport/{signals-state-save-restore.c => signals-state-save-restore.cc} (100%)
 rename gdbsupport/{signals.c => signals.cc} (100%)
 rename gdbsupport/{tdesc.c => tdesc.cc} (100%)
 rename gdbsupport/{thread-pool.c => thread-pool.cc} (100%)
 rename gdbsupport/{xml-utils.c => xml-utils.cc} (100%)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 60a52d3412b9..d912a0babef9 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -207,32 +207,32 @@ SFILES = \
 	$(srcdir)/../gdb/arch/arm-get-next-pcs.c \
 	$(srcdir)/../gdb/arch/arm-linux.c \
 	$(srcdir)/../gdb/arch/ppc-linux-common.c \
-	$(srcdir)/../gdbsupport/btrace-common.c \
-	$(srcdir)/../gdbsupport/buffer.c \
-	$(srcdir)/../gdbsupport/cleanups.c \
-	$(srcdir)/../gdbsupport/common-debug.c \
-	$(srcdir)/../gdbsupport/common-exceptions.c \
-	$(srcdir)/../gdbsupport/common-inferior.c \
-	$(srcdir)/../gdbsupport/common-regcache.c \
-	$(srcdir)/../gdbsupport/common-utils.c \
-	$(srcdir)/../gdbsupport/errors.c \
-	$(srcdir)/../gdbsupport/environ.c \
-	$(srcdir)/../gdbsupport/fileio.c \
-	$(srcdir)/../gdbsupport/filestuff.c \
-	$(srcdir)/../gdbsupport/job-control.c \
-	$(srcdir)/../gdbsupport/gdb-dlfcn.c \
-	$(srcdir)/../gdbsupport/gdb_tilde_expand.c \
-	$(srcdir)/../gdbsupport/gdb_vecs.c \
-	$(srcdir)/../gdbsupport/gdb_wait.c \
-	$(srcdir)/../gdbsupport/netstuff.c \
-	$(srcdir)/../gdbsupport/new-op.c \
-	$(srcdir)/../gdbsupport/pathstuff.c \
-	$(srcdir)/../gdbsupport/print-utils.c \
-	$(srcdir)/../gdbsupport/ptid.c \
-	$(srcdir)/../gdbsupport/rsp-low.c \
-	$(srcdir)/../gdbsupport/safe-strerror.c \
-	$(srcdir)/../gdbsupport/tdesc.c \
-	$(srcdir)/../gdbsupport/xml-utils.c \
+	$(srcdir)/../gdbsupport/btrace-common.cc \
+	$(srcdir)/../gdbsupport/buffer.cc \
+	$(srcdir)/../gdbsupport/cleanups.cc \
+	$(srcdir)/../gdbsupport/common-debug.cc \
+	$(srcdir)/../gdbsupport/common-exceptions.cc \
+	$(srcdir)/../gdbsupport/common-inferior.cc \
+	$(srcdir)/../gdbsupport/common-regcache.cc \
+	$(srcdir)/../gdbsupport/common-utils.cc \
+	$(srcdir)/../gdbsupport/errors.cc \
+	$(srcdir)/../gdbsupport/environ.cc \
+	$(srcdir)/../gdbsupport/fileio.cc \
+	$(srcdir)/../gdbsupport/filestuff.cc \
+	$(srcdir)/../gdbsupport/job-control.cc \
+	$(srcdir)/../gdbsupport/gdb-dlfcn.cc \
+	$(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
+	$(srcdir)/../gdbsupport/gdb_vecs.cc \
+	$(srcdir)/../gdbsupport/gdb_wait.cc \
+	$(srcdir)/../gdbsupport/netstuff.cc \
+	$(srcdir)/../gdbsupport/new-op.cc \
+	$(srcdir)/../gdbsupport/pathstuff.cc \
+	$(srcdir)/../gdbsupport/print-utils.cc \
+	$(srcdir)/../gdbsupport/ptid.cc \
+	$(srcdir)/../gdbsupport/rsp-low.cc \
+	$(srcdir)/../gdbsupport/safe-strerror.cc \
+	$(srcdir)/../gdbsupport/tdesc.cc \
+	$(srcdir)/../gdbsupport/xml-utils.cc \
 	$(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
 	$(srcdir)/../gdb/nat/linux-btrace.c \
 	$(srcdir)/../gdb/nat/linux-namespaces.c \
@@ -600,7 +600,7 @@ arch/%-ipa.o: ../gdb/arch/%.c
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)

-gdbsupport/%-ipa.o: ../gdbsupport/%.c
+gdbsupport/%-ipa.o: ../gdbsupport/%.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)

@@ -633,7 +633,7 @@ arch/%.o: ../gdb/arch/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)

-gdbsupport/%.o: ../gdbsupport/%.c
+gdbsupport/%.o: ../gdbsupport/%.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)

diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index cd7b0adf6b4c..0e997cf2cc08 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -24,53 +24,48 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd

-override CXX += $(CXX_DIALECT)
-
-override CC := $(CXX)
-override CFLAGS := $(CXXFLAGS)
-
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CXXFLAGS = $(CXX_DIALECT) $(WARN_CFLAGS) $(WERROR_CFLAGS)

 noinst_LIBRARIES = libgdbsupport.a

 if SELFTEST
-selftest = selftest.c
+selftest = selftest.cc
 endif

 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)

 # Double-check that no defines are missing from our configury.
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index be4d53545311..4e12354598be 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -177,18 +177,19 @@ DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 =
 SOURCES = $(libgdbsupport_a_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -353,50 +354,50 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd

-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CXXFLAGS = $(CXX_DIALECT) $(WARN_CFLAGS) $(WERROR_CFLAGS)
 noinst_LIBRARIES = libgdbsupport.a
-@SELFTEST_TRUE@selftest = selftest.c
+@SELFTEST_TRUE@selftest = selftest.cc
 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)

 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am

 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .cc .o .obj
 am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
@@ -495,19 +496,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-pool.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml-utils.Po@am__quote@

-.c.o:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+.cc.o:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<

-.c.obj:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`

 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -692,11 +693,6 @@ uninstall-am:
 .PRECIOUS: Makefile


-override CXX += $(CXX_DIALECT)
-
-override CC := $(CXX)
-override CFLAGS := $(CXXFLAGS)
-
 # Double-check that no defines are missing from our configury.
 check-defines:
 	cd $(srcdir) && emacs --script check-defines.el
diff --git a/gdbsupport/agent.c b/gdbsupport/agent.cc
similarity index 100%
rename from gdbsupport/agent.c
rename to gdbsupport/agent.cc
diff --git a/gdbsupport/btrace-common.c b/gdbsupport/btrace-common.cc
similarity index 100%
rename from gdbsupport/btrace-common.c
rename to gdbsupport/btrace-common.cc
diff --git a/gdbsupport/buffer.c b/gdbsupport/buffer.cc
similarity index 100%
rename from gdbsupport/buffer.c
rename to gdbsupport/buffer.cc
diff --git a/gdbsupport/cleanups.c b/gdbsupport/cleanups.cc
similarity index 100%
rename from gdbsupport/cleanups.c
rename to gdbsupport/cleanups.cc
diff --git a/gdbsupport/common-debug.c b/gdbsupport/common-debug.cc
similarity index 100%
rename from gdbsupport/common-debug.c
rename to gdbsupport/common-debug.cc
diff --git a/gdbsupport/common-exceptions.c b/gdbsupport/common-exceptions.cc
similarity index 100%
rename from gdbsupport/common-exceptions.c
rename to gdbsupport/common-exceptions.cc
diff --git a/gdbsupport/common-inferior.c b/gdbsupport/common-inferior.cc
similarity index 100%
rename from gdbsupport/common-inferior.c
rename to gdbsupport/common-inferior.cc
diff --git a/gdbsupport/common-regcache.c b/gdbsupport/common-regcache.cc
similarity index 100%
rename from gdbsupport/common-regcache.c
rename to gdbsupport/common-regcache.cc
diff --git a/gdbsupport/common-utils.c b/gdbsupport/common-utils.cc
similarity index 100%
rename from gdbsupport/common-utils.c
rename to gdbsupport/common-utils.cc
diff --git a/gdbsupport/environ.c b/gdbsupport/environ.cc
similarity index 100%
rename from gdbsupport/environ.c
rename to gdbsupport/environ.cc
diff --git a/gdbsupport/errors.c b/gdbsupport/errors.cc
similarity index 100%
rename from gdbsupport/errors.c
rename to gdbsupport/errors.cc
diff --git a/gdbsupport/fileio.c b/gdbsupport/fileio.cc
similarity index 100%
rename from gdbsupport/fileio.c
rename to gdbsupport/fileio.cc
diff --git a/gdbsupport/filestuff.c b/gdbsupport/filestuff.cc
similarity index 100%
rename from gdbsupport/filestuff.c
rename to gdbsupport/filestuff.cc
diff --git a/gdbsupport/format.c b/gdbsupport/format.cc
similarity index 100%
rename from gdbsupport/format.c
rename to gdbsupport/format.cc
diff --git a/gdbsupport/gdb-dlfcn.c b/gdbsupport/gdb-dlfcn.cc
similarity index 100%
rename from gdbsupport/gdb-dlfcn.c
rename to gdbsupport/gdb-dlfcn.cc
diff --git a/gdbsupport/gdb_tilde_expand.c b/gdbsupport/gdb_tilde_expand.cc
similarity index 100%
rename from gdbsupport/gdb_tilde_expand.c
rename to gdbsupport/gdb_tilde_expand.cc
diff --git a/gdbsupport/gdb_vecs.c b/gdbsupport/gdb_vecs.cc
similarity index 100%
rename from gdbsupport/gdb_vecs.c
rename to gdbsupport/gdb_vecs.cc
diff --git a/gdbsupport/gdb_wait.c b/gdbsupport/gdb_wait.cc
similarity index 100%
rename from gdbsupport/gdb_wait.c
rename to gdbsupport/gdb_wait.cc
diff --git a/gdbsupport/job-control.c b/gdbsupport/job-control.cc
similarity index 100%
rename from gdbsupport/job-control.c
rename to gdbsupport/job-control.cc
diff --git a/gdbsupport/netstuff.c b/gdbsupport/netstuff.cc
similarity index 100%
rename from gdbsupport/netstuff.c
rename to gdbsupport/netstuff.cc
diff --git a/gdbsupport/new-op.c b/gdbsupport/new-op.cc
similarity index 100%
rename from gdbsupport/new-op.c
rename to gdbsupport/new-op.cc
diff --git a/gdbsupport/pathstuff.c b/gdbsupport/pathstuff.cc
similarity index 100%
rename from gdbsupport/pathstuff.c
rename to gdbsupport/pathstuff.cc
diff --git a/gdbsupport/print-utils.c b/gdbsupport/print-utils.cc
similarity index 100%
rename from gdbsupport/print-utils.c
rename to gdbsupport/print-utils.cc
diff --git a/gdbsupport/ptid.c b/gdbsupport/ptid.cc
similarity index 100%
rename from gdbsupport/ptid.c
rename to gdbsupport/ptid.cc
diff --git a/gdbsupport/rsp-low.c b/gdbsupport/rsp-low.cc
similarity index 100%
rename from gdbsupport/rsp-low.c
rename to gdbsupport/rsp-low.cc
diff --git a/gdbsupport/run-time-clock.c b/gdbsupport/run-time-clock.cc
similarity index 100%
rename from gdbsupport/run-time-clock.c
rename to gdbsupport/run-time-clock.cc
diff --git a/gdbsupport/safe-strerror.c b/gdbsupport/safe-strerror.cc
similarity index 100%
rename from gdbsupport/safe-strerror.c
rename to gdbsupport/safe-strerror.cc
diff --git a/gdbsupport/scoped_mmap.c b/gdbsupport/scoped_mmap.cc
similarity index 100%
rename from gdbsupport/scoped_mmap.c
rename to gdbsupport/scoped_mmap.cc
diff --git a/gdbsupport/selftest.c b/gdbsupport/selftest.cc
similarity index 100%
rename from gdbsupport/selftest.c
rename to gdbsupport/selftest.cc
diff --git a/gdbsupport/signals-state-save-restore.c b/gdbsupport/signals-state-save-restore.cc
similarity index 100%
rename from gdbsupport/signals-state-save-restore.c
rename to gdbsupport/signals-state-save-restore.cc
diff --git a/gdbsupport/signals.c b/gdbsupport/signals.cc
similarity index 100%
rename from gdbsupport/signals.c
rename to gdbsupport/signals.cc
diff --git a/gdbsupport/tdesc.c b/gdbsupport/tdesc.cc
similarity index 100%
rename from gdbsupport/tdesc.c
rename to gdbsupport/tdesc.cc
diff --git a/gdbsupport/thread-pool.c b/gdbsupport/thread-pool.cc
similarity index 100%
rename from gdbsupport/thread-pool.c
rename to gdbsupport/thread-pool.cc
diff --git a/gdbsupport/xml-utils.c b/gdbsupport/xml-utils.cc
similarity index 100%
rename from gdbsupport/xml-utils.c
rename to gdbsupport/xml-utils.cc
-- 
2.25.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdbserver: rename source files to .cc
  2020-02-13 14:05   ` Tom Tromey
@ 2020-02-13 14:48     ` Simon Marchi
  2020-02-13 15:08       ` Tom Tromey
  2020-02-13 15:28       ` Aktemur, Tankut Baris
  0 siblings, 2 replies; 12+ messages in thread
From: Simon Marchi @ 2020-02-13 14:48 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches, Tankut Baris Aktemur

On 2020-02-13 9:05 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> For the same reasons outlined in the previous patch, this patch renames
> Simon> gdbserver source files to .cc.
> 
> I support this as well, but I wonder if it would be easier for Tankut if
> we held off landing this patch until his big target_ops series goes in.
> 
> Tom
> 

I just tried applying his series over mine with `git am -3` (using git 2.25, if
that matters), and it applied just fine.  Otherwise, supposing I merge mine, using
git-rebase to rebase his branch on master should work fine as well.

Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdbserver: rename source files to .cc
  2020-02-13 14:48     ` Simon Marchi
@ 2020-02-13 15:08       ` Tom Tromey
  2020-02-13 15:28       ` Aktemur, Tankut Baris
  1 sibling, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-13 15:08 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, Simon Marchi, gdb-patches, Tankut Baris Aktemur

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> I just tried applying his series over mine with `git am -3` (using git 2.25, if
Simon> that matters), and it applied just fine.

Works for me!

Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [PATCH 2/2] gdbserver: rename source files to .cc
  2020-02-13 14:48     ` Simon Marchi
  2020-02-13 15:08       ` Tom Tromey
@ 2020-02-13 15:28       ` Aktemur, Tankut Baris
  1 sibling, 0 replies; 12+ messages in thread
From: Aktemur, Tankut Baris @ 2020-02-13 15:28 UTC (permalink / raw)
  To: Simon Marchi, Tom Tromey, Simon Marchi; +Cc: gdb-patches

On Thursday, February 13, 2020 3:49 PM, Simon Marchi wrote:
> On 2020-02-13 9:05 a.m., Tom Tromey wrote:
> >>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> >
> > Simon> For the same reasons outlined in the previous patch, this patch renames
> > Simon> gdbserver source files to .cc.
> >
> > I support this as well, but I wonder if it would be easier for Tankut if
> > we held off landing this patch until his big target_ops series goes in.
> >
> > Tom
> >
> 
> I just tried applying his series over mine with `git am -3` (using git 2.25, if
> that matters), and it applied just fine.  Otherwise, supposing I merge mine, using
> git-rebase to rebase his branch on master should work fine as well.
> 
> Simon

Thanks for checking this!

-Baris


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-13 14:05 ` [PATCH 1/2] gdbsupport: " Tom Tromey
  2020-02-13 14:41   ` Simon Marchi
@ 2020-02-13 18:34   ` Pedro Alves
  2020-02-13 21:22     ` Simon Marchi
  1 sibling, 1 reply; 12+ messages in thread
From: Pedro Alves @ 2020-02-13 18:34 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 2/13/20 2:04 PM, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> This patch renames the .c source files in gdbsupport to .cc.
> 
> I support this change.
> 
> Note that this would let us remove these hacks from gdbsupport/Makefile.am:
> 
> override CXX += $(CXX_DIALECT)
> 
> override CC := $(CXX)
> override CFLAGS := $(CXXFLAGS)
> 
> AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
> 
> 
> The CC and CFLAGS settings can be removed entirely.  AM_CFLAGS can be
> renamed to AM_CXXFLAGS, and the CXX_DIALECT can be put there.

I had preferred overriding CXX instead of CXXFLAGS for the reasons
explained at [1] [2].  Sounds like that defeats it.

[1] https://sourceware.org/ml/gdb-patches/2020-01/msg00453.html
[2] https://sourceware.org/ml/gdb-patches/2020-01/msg00460.html

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-13 18:34   ` Pedro Alves
@ 2020-02-13 21:22     ` Simon Marchi
  2020-02-13 21:26       ` Pedro Alves
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Marchi @ 2020-02-13 21:22 UTC (permalink / raw)
  To: Pedro Alves, Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 2020-02-13 1:33 p.m., Pedro Alves wrote:
> On 2/13/20 2:04 PM, Tom Tromey wrote:
>>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
>>
>> Simon> This patch renames the .c source files in gdbsupport to .cc.
>>
>> I support this change.
>>
>> Note that this would let us remove these hacks from gdbsupport/Makefile.am:
>>
>> override CXX += $(CXX_DIALECT)
>>
>> override CC := $(CXX)
>> override CFLAGS := $(CXXFLAGS)
>>
>> AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
>>
>>
>> The CC and CFLAGS settings can be removed entirely.  AM_CFLAGS can be
>> renamed to AM_CXXFLAGS, and the CXX_DIALECT can be put there.
> 
> I had preferred overriding CXX instead of CXXFLAGS for the reasons
> explained at [1] [2].  Sounds like that defeats it.
> 
> [1] https://sourceware.org/ml/gdb-patches/2020-01/msg00453.html
> [2] https://sourceware.org/ml/gdb-patches/2020-01/msg00460.html
> 
> Thanks,
> Pedro Alves
> 

No problem.  Here's the updated patch.

Given that you have not commented on it, I presume you don't object to renaming these files?


From 9fd1aad643992cc3439e022e166807e7af121b1c Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@efficios.com>
Date: Wed, 12 Feb 2020 16:10:10 -0500
Subject: [PATCH] gdbsupport: rename source files to .cc

This patch renames the .c source files in gdbsupport to .cc.

In the gdb directory, there is an argument against renaming the source
files, which is that it makes using some git commands more difficult to
do archeology.  Some commands have some kind of "follow" option that
makes git try to follow renames, but it doesn't work in all situations.

Given that we have just moved the gdbsupport directory, that argument
doesn't hold for source files in that directory.  I therefore suggest
renaming them to .cc, so that they are automatically recognized as C++
by various tools and editors.

The original motivation behind this is that when building gdbsupport
with clang, I get:

      CC       agent.o
    clang: error: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Werror,-Wdeprecated]

In the gdb/ directory, we make clang happy by passing "-x c++".  We
could do this in gdbsupport too, but I think that renaming the files is
a better long-term solution.

gdbserver still does its own build of gdbsupport, so a few changes in
its Makefile are necessary.

gdbsupport/ChangeLog:

	* Makefile.am: Rename source files from .c to .cc.
	(CC, CFLAGS): Don't override.
	(AM_CFLAGS): Rename to ...
	(AM_CXXFLAGS): ... this.
	* Makefile.in: Re-generate.
	* %.c: Rename to %.cc.

gdbserver/ChangeLog:

	* Makefile.in: Rename gdbsupport source files from .c to .cc.
---
 gdbserver/Makefile.in                         |  56 ++++----
 gdbsupport/Makefile.am                        |  73 +++++-----
 gdbsupport/Makefile.in                        | 126 +++++++++---------
 gdbsupport/{agent.c => agent.cc}              |   0
 .../{btrace-common.c => btrace-common.cc}     |   0
 gdbsupport/{buffer.c => buffer.cc}            |   0
 gdbsupport/{cleanups.c => cleanups.cc}        |   0
 .../{common-debug.c => common-debug.cc}       |   0
 ...mmon-exceptions.c => common-exceptions.cc} |   0
 .../{common-inferior.c => common-inferior.cc} |   0
 .../{common-regcache.c => common-regcache.cc} |   0
 .../{common-utils.c => common-utils.cc}       |   0
 gdbsupport/{environ.c => environ.cc}          |   0
 gdbsupport/{errors.c => errors.cc}            |   0
 gdbsupport/{fileio.c => fileio.cc}            |   0
 gdbsupport/{filestuff.c => filestuff.cc}      |   0
 gdbsupport/{format.c => format.cc}            |   0
 gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc}      |   0
 ...gdb_tilde_expand.c => gdb_tilde_expand.cc} |   0
 gdbsupport/{gdb_vecs.c => gdb_vecs.cc}        |   0
 gdbsupport/{gdb_wait.c => gdb_wait.cc}        |   0
 gdbsupport/{job-control.c => job-control.cc}  |   0
 gdbsupport/{netstuff.c => netstuff.cc}        |   0
 gdbsupport/{new-op.c => new-op.cc}            |   0
 gdbsupport/{pathstuff.c => pathstuff.cc}      |   0
 gdbsupport/{print-utils.c => print-utils.cc}  |   0
 gdbsupport/{ptid.c => ptid.cc}                |   0
 gdbsupport/{rsp-low.c => rsp-low.cc}          |   0
 .../{run-time-clock.c => run-time-clock.cc}   |   0
 .../{safe-strerror.c => safe-strerror.cc}     |   0
 gdbsupport/{scoped_mmap.c => scoped_mmap.cc}  |   0
 gdbsupport/{selftest.c => selftest.cc}        |   0
 ...estore.c => signals-state-save-restore.cc} |   0
 gdbsupport/{signals.c => signals.cc}          |   0
 gdbsupport/{tdesc.c => tdesc.cc}              |   0
 gdbsupport/{thread-pool.c => thread-pool.cc}  |   0
 gdbsupport/{xml-utils.c => xml-utils.cc}      |   0
 gnulib/Makefile.in                            |   4 +-
 38 files changed, 126 insertions(+), 133 deletions(-)
 rename gdbsupport/{agent.c => agent.cc} (100%)
 rename gdbsupport/{btrace-common.c => btrace-common.cc} (100%)
 rename gdbsupport/{buffer.c => buffer.cc} (100%)
 rename gdbsupport/{cleanups.c => cleanups.cc} (100%)
 rename gdbsupport/{common-debug.c => common-debug.cc} (100%)
 rename gdbsupport/{common-exceptions.c => common-exceptions.cc} (100%)
 rename gdbsupport/{common-inferior.c => common-inferior.cc} (100%)
 rename gdbsupport/{common-regcache.c => common-regcache.cc} (100%)
 rename gdbsupport/{common-utils.c => common-utils.cc} (100%)
 rename gdbsupport/{environ.c => environ.cc} (100%)
 rename gdbsupport/{errors.c => errors.cc} (100%)
 rename gdbsupport/{fileio.c => fileio.cc} (100%)
 rename gdbsupport/{filestuff.c => filestuff.cc} (100%)
 rename gdbsupport/{format.c => format.cc} (100%)
 rename gdbsupport/{gdb-dlfcn.c => gdb-dlfcn.cc} (100%)
 rename gdbsupport/{gdb_tilde_expand.c => gdb_tilde_expand.cc} (100%)
 rename gdbsupport/{gdb_vecs.c => gdb_vecs.cc} (100%)
 rename gdbsupport/{gdb_wait.c => gdb_wait.cc} (100%)
 rename gdbsupport/{job-control.c => job-control.cc} (100%)
 rename gdbsupport/{netstuff.c => netstuff.cc} (100%)
 rename gdbsupport/{new-op.c => new-op.cc} (100%)
 rename gdbsupport/{pathstuff.c => pathstuff.cc} (100%)
 rename gdbsupport/{print-utils.c => print-utils.cc} (100%)
 rename gdbsupport/{ptid.c => ptid.cc} (100%)
 rename gdbsupport/{rsp-low.c => rsp-low.cc} (100%)
 rename gdbsupport/{run-time-clock.c => run-time-clock.cc} (100%)
 rename gdbsupport/{safe-strerror.c => safe-strerror.cc} (100%)
 rename gdbsupport/{scoped_mmap.c => scoped_mmap.cc} (100%)
 rename gdbsupport/{selftest.c => selftest.cc} (100%)
 rename gdbsupport/{signals-state-save-restore.c => signals-state-save-restore.cc} (100%)
 rename gdbsupport/{signals.c => signals.cc} (100%)
 rename gdbsupport/{tdesc.c => tdesc.cc} (100%)
 rename gdbsupport/{thread-pool.c => thread-pool.cc} (100%)
 rename gdbsupport/{xml-utils.c => xml-utils.cc} (100%)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 60a52d3412b9..d912a0babef9 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -207,32 +207,32 @@ SFILES = \
 	$(srcdir)/../gdb/arch/arm-get-next-pcs.c \
 	$(srcdir)/../gdb/arch/arm-linux.c \
 	$(srcdir)/../gdb/arch/ppc-linux-common.c \
-	$(srcdir)/../gdbsupport/btrace-common.c \
-	$(srcdir)/../gdbsupport/buffer.c \
-	$(srcdir)/../gdbsupport/cleanups.c \
-	$(srcdir)/../gdbsupport/common-debug.c \
-	$(srcdir)/../gdbsupport/common-exceptions.c \
-	$(srcdir)/../gdbsupport/common-inferior.c \
-	$(srcdir)/../gdbsupport/common-regcache.c \
-	$(srcdir)/../gdbsupport/common-utils.c \
-	$(srcdir)/../gdbsupport/errors.c \
-	$(srcdir)/../gdbsupport/environ.c \
-	$(srcdir)/../gdbsupport/fileio.c \
-	$(srcdir)/../gdbsupport/filestuff.c \
-	$(srcdir)/../gdbsupport/job-control.c \
-	$(srcdir)/../gdbsupport/gdb-dlfcn.c \
-	$(srcdir)/../gdbsupport/gdb_tilde_expand.c \
-	$(srcdir)/../gdbsupport/gdb_vecs.c \
-	$(srcdir)/../gdbsupport/gdb_wait.c \
-	$(srcdir)/../gdbsupport/netstuff.c \
-	$(srcdir)/../gdbsupport/new-op.c \
-	$(srcdir)/../gdbsupport/pathstuff.c \
-	$(srcdir)/../gdbsupport/print-utils.c \
-	$(srcdir)/../gdbsupport/ptid.c \
-	$(srcdir)/../gdbsupport/rsp-low.c \
-	$(srcdir)/../gdbsupport/safe-strerror.c \
-	$(srcdir)/../gdbsupport/tdesc.c \
-	$(srcdir)/../gdbsupport/xml-utils.c \
+	$(srcdir)/../gdbsupport/btrace-common.cc \
+	$(srcdir)/../gdbsupport/buffer.cc \
+	$(srcdir)/../gdbsupport/cleanups.cc \
+	$(srcdir)/../gdbsupport/common-debug.cc \
+	$(srcdir)/../gdbsupport/common-exceptions.cc \
+	$(srcdir)/../gdbsupport/common-inferior.cc \
+	$(srcdir)/../gdbsupport/common-regcache.cc \
+	$(srcdir)/../gdbsupport/common-utils.cc \
+	$(srcdir)/../gdbsupport/errors.cc \
+	$(srcdir)/../gdbsupport/environ.cc \
+	$(srcdir)/../gdbsupport/fileio.cc \
+	$(srcdir)/../gdbsupport/filestuff.cc \
+	$(srcdir)/../gdbsupport/job-control.cc \
+	$(srcdir)/../gdbsupport/gdb-dlfcn.cc \
+	$(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
+	$(srcdir)/../gdbsupport/gdb_vecs.cc \
+	$(srcdir)/../gdbsupport/gdb_wait.cc \
+	$(srcdir)/../gdbsupport/netstuff.cc \
+	$(srcdir)/../gdbsupport/new-op.cc \
+	$(srcdir)/../gdbsupport/pathstuff.cc \
+	$(srcdir)/../gdbsupport/print-utils.cc \
+	$(srcdir)/../gdbsupport/ptid.cc \
+	$(srcdir)/../gdbsupport/rsp-low.cc \
+	$(srcdir)/../gdbsupport/safe-strerror.cc \
+	$(srcdir)/../gdbsupport/tdesc.cc \
+	$(srcdir)/../gdbsupport/xml-utils.cc \
 	$(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
 	$(srcdir)/../gdb/nat/linux-btrace.c \
 	$(srcdir)/../gdb/nat/linux-namespaces.c \
@@ -600,7 +600,7 @@ arch/%-ipa.o: ../gdb/arch/%.c
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)

-gdbsupport/%-ipa.o: ../gdbsupport/%.c
+gdbsupport/%-ipa.o: ../gdbsupport/%.cc
 	$(IPAGENT_COMPILE) $<
 	$(POSTCOMPILE)

@@ -633,7 +633,7 @@ arch/%.o: ../gdb/arch/%.c
 	$(COMPILE) $<
 	$(POSTCOMPILE)

-gdbsupport/%.o: ../gdbsupport/%.c
+gdbsupport/%.o: ../gdbsupport/%.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)

diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index cd7b0adf6b4c..ee78a891b3b7 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -26,51 +26,48 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \

 override CXX += $(CXX_DIALECT)

-override CC := $(CXX)
-override CFLAGS := $(CXXFLAGS)
-
-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CXXFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)

 noinst_LIBRARIES = libgdbsupport.a

 if SELFTEST
-selftest = selftest.c
+selftest = selftest.cc
 endif

 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)

 # Double-check that no defines are missing from our configury.
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index be4d53545311..4e12354598be 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -177,18 +177,19 @@ DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/../depcomp
 am__depfiles_maybe = depfiles
 am__mv = mv -f
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
-	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo "  CC      " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo "  CCLD    " $@;
-am__v_CCLD_1 =
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo "  CXX     " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo "  CXXLD   " $@;
+am__v_CXXLD_1 =
 SOURCES = $(libgdbsupport_a_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
@@ -353,50 +354,50 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd

-AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+AM_CXXFLAGS = $(CXX_DIALECT) $(WARN_CFLAGS) $(WERROR_CFLAGS)
 noinst_LIBRARIES = libgdbsupport.a
-@SELFTEST_TRUE@selftest = selftest.c
+@SELFTEST_TRUE@selftest = selftest.cc
 libgdbsupport_a_SOURCES = \
-    agent.c \
-    btrace-common.c \
-    buffer.c \
-    cleanups.c \
-    common-debug.c \
-    common-exceptions.c	\
-    common-inferior.c \
-    common-regcache.c \
-    common-utils.c \
-    environ.c \
-    errors.c \
-    fileio.c \
-    filestuff.c	\
-    format.c \
-    gdb-dlfcn.c	\
-    gdb_tilde_expand.c \
-    gdb_wait.c \
-    gdb_vecs.c \
-    job-control.c \
-    netstuff.c \
-    new-op.c \
-    pathstuff.c	\
-    print-utils.c \
-    ptid.c \
-    rsp-low.c \
-    run-time-clock.c \
-    safe-strerror.c \
-    scoped_mmap.c \
-    signals.c \
-    signals-state-save-restore.c \
-    tdesc.c \
-    thread-pool.c \
-    xml-utils.c	\
+    agent.cc \
+    btrace-common.cc \
+    buffer.cc \
+    cleanups.cc \
+    common-debug.cc \
+    common-exceptions.cc \
+    common-inferior.cc \
+    common-regcache.cc \
+    common-utils.cc \
+    environ.cc \
+    errors.cc \
+    fileio.cc \
+    filestuff.cc \
+    format.cc \
+    gdb-dlfcn.cc \
+    gdb_tilde_expand.cc \
+    gdb_wait.cc \
+    gdb_vecs.cc \
+    job-control.cc \
+    netstuff.cc \
+    new-op.cc \
+    pathstuff.cc \
+    print-utils.cc \
+    ptid.cc \
+    rsp-low.cc \
+    run-time-clock.cc \
+    safe-strerror.cc \
+    scoped_mmap.cc \
+    signals.cc \
+    signals-state-save-restore.cc \
+    tdesc.cc \
+    thread-pool.cc \
+    xml-utils.cc \
     $(selftest)

 all: config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am

 .SUFFIXES:
-.SUFFIXES: .c .o .obj
+.SUFFIXES: .cc .o .obj
 am--refresh: Makefile
 	@:
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
@@ -495,19 +496,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-pool.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml-utils.Po@am__quote@

-.c.o:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+.cc.o:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<

-.c.obj:
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+.cc.obj:
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`

 ID: $(am__tagged_files)
 	$(am__define_uniq_tagged_files); mkid -fID $$unique
@@ -692,11 +693,6 @@ uninstall-am:
 .PRECIOUS: Makefile


-override CXX += $(CXX_DIALECT)
-
-override CC := $(CXX)
-override CFLAGS := $(CXXFLAGS)
-
 # Double-check that no defines are missing from our configury.
 check-defines:
 	cd $(srcdir) && emacs --script check-defines.el
diff --git a/gdbsupport/agent.c b/gdbsupport/agent.cc
similarity index 100%
rename from gdbsupport/agent.c
rename to gdbsupport/agent.cc
diff --git a/gdbsupport/btrace-common.c b/gdbsupport/btrace-common.cc
similarity index 100%
rename from gdbsupport/btrace-common.c
rename to gdbsupport/btrace-common.cc
diff --git a/gdbsupport/buffer.c b/gdbsupport/buffer.cc
similarity index 100%
rename from gdbsupport/buffer.c
rename to gdbsupport/buffer.cc
diff --git a/gdbsupport/cleanups.c b/gdbsupport/cleanups.cc
similarity index 100%
rename from gdbsupport/cleanups.c
rename to gdbsupport/cleanups.cc
diff --git a/gdbsupport/common-debug.c b/gdbsupport/common-debug.cc
similarity index 100%
rename from gdbsupport/common-debug.c
rename to gdbsupport/common-debug.cc
diff --git a/gdbsupport/common-exceptions.c b/gdbsupport/common-exceptions.cc
similarity index 100%
rename from gdbsupport/common-exceptions.c
rename to gdbsupport/common-exceptions.cc
diff --git a/gdbsupport/common-inferior.c b/gdbsupport/common-inferior.cc
similarity index 100%
rename from gdbsupport/common-inferior.c
rename to gdbsupport/common-inferior.cc
diff --git a/gdbsupport/common-regcache.c b/gdbsupport/common-regcache.cc
similarity index 100%
rename from gdbsupport/common-regcache.c
rename to gdbsupport/common-regcache.cc
diff --git a/gdbsupport/common-utils.c b/gdbsupport/common-utils.cc
similarity index 100%
rename from gdbsupport/common-utils.c
rename to gdbsupport/common-utils.cc
diff --git a/gdbsupport/environ.c b/gdbsupport/environ.cc
similarity index 100%
rename from gdbsupport/environ.c
rename to gdbsupport/environ.cc
diff --git a/gdbsupport/errors.c b/gdbsupport/errors.cc
similarity index 100%
rename from gdbsupport/errors.c
rename to gdbsupport/errors.cc
diff --git a/gdbsupport/fileio.c b/gdbsupport/fileio.cc
similarity index 100%
rename from gdbsupport/fileio.c
rename to gdbsupport/fileio.cc
diff --git a/gdbsupport/filestuff.c b/gdbsupport/filestuff.cc
similarity index 100%
rename from gdbsupport/filestuff.c
rename to gdbsupport/filestuff.cc
diff --git a/gdbsupport/format.c b/gdbsupport/format.cc
similarity index 100%
rename from gdbsupport/format.c
rename to gdbsupport/format.cc
diff --git a/gdbsupport/gdb-dlfcn.c b/gdbsupport/gdb-dlfcn.cc
similarity index 100%
rename from gdbsupport/gdb-dlfcn.c
rename to gdbsupport/gdb-dlfcn.cc
diff --git a/gdbsupport/gdb_tilde_expand.c b/gdbsupport/gdb_tilde_expand.cc
similarity index 100%
rename from gdbsupport/gdb_tilde_expand.c
rename to gdbsupport/gdb_tilde_expand.cc
diff --git a/gdbsupport/gdb_vecs.c b/gdbsupport/gdb_vecs.cc
similarity index 100%
rename from gdbsupport/gdb_vecs.c
rename to gdbsupport/gdb_vecs.cc
diff --git a/gdbsupport/gdb_wait.c b/gdbsupport/gdb_wait.cc
similarity index 100%
rename from gdbsupport/gdb_wait.c
rename to gdbsupport/gdb_wait.cc
diff --git a/gdbsupport/job-control.c b/gdbsupport/job-control.cc
similarity index 100%
rename from gdbsupport/job-control.c
rename to gdbsupport/job-control.cc
diff --git a/gdbsupport/netstuff.c b/gdbsupport/netstuff.cc
similarity index 100%
rename from gdbsupport/netstuff.c
rename to gdbsupport/netstuff.cc
diff --git a/gdbsupport/new-op.c b/gdbsupport/new-op.cc
similarity index 100%
rename from gdbsupport/new-op.c
rename to gdbsupport/new-op.cc
diff --git a/gdbsupport/pathstuff.c b/gdbsupport/pathstuff.cc
similarity index 100%
rename from gdbsupport/pathstuff.c
rename to gdbsupport/pathstuff.cc
diff --git a/gdbsupport/print-utils.c b/gdbsupport/print-utils.cc
similarity index 100%
rename from gdbsupport/print-utils.c
rename to gdbsupport/print-utils.cc
diff --git a/gdbsupport/ptid.c b/gdbsupport/ptid.cc
similarity index 100%
rename from gdbsupport/ptid.c
rename to gdbsupport/ptid.cc
diff --git a/gdbsupport/rsp-low.c b/gdbsupport/rsp-low.cc
similarity index 100%
rename from gdbsupport/rsp-low.c
rename to gdbsupport/rsp-low.cc
diff --git a/gdbsupport/run-time-clock.c b/gdbsupport/run-time-clock.cc
similarity index 100%
rename from gdbsupport/run-time-clock.c
rename to gdbsupport/run-time-clock.cc
diff --git a/gdbsupport/safe-strerror.c b/gdbsupport/safe-strerror.cc
similarity index 100%
rename from gdbsupport/safe-strerror.c
rename to gdbsupport/safe-strerror.cc
diff --git a/gdbsupport/scoped_mmap.c b/gdbsupport/scoped_mmap.cc
similarity index 100%
rename from gdbsupport/scoped_mmap.c
rename to gdbsupport/scoped_mmap.cc
diff --git a/gdbsupport/selftest.c b/gdbsupport/selftest.cc
similarity index 100%
rename from gdbsupport/selftest.c
rename to gdbsupport/selftest.cc
diff --git a/gdbsupport/signals-state-save-restore.c b/gdbsupport/signals-state-save-restore.cc
similarity index 100%
rename from gdbsupport/signals-state-save-restore.c
rename to gdbsupport/signals-state-save-restore.cc
diff --git a/gdbsupport/signals.c b/gdbsupport/signals.cc
similarity index 100%
rename from gdbsupport/signals.c
rename to gdbsupport/signals.cc
diff --git a/gdbsupport/tdesc.c b/gdbsupport/tdesc.cc
similarity index 100%
rename from gdbsupport/tdesc.c
rename to gdbsupport/tdesc.cc
diff --git a/gdbsupport/thread-pool.c b/gdbsupport/thread-pool.cc
similarity index 100%
rename from gdbsupport/thread-pool.c
rename to gdbsupport/thread-pool.cc
diff --git a/gdbsupport/xml-utils.c b/gdbsupport/xml-utils.cc
similarity index 100%
rename from gdbsupport/xml-utils.c
rename to gdbsupport/xml-utils.cc
diff --git a/gnulib/Makefile.in b/gnulib/Makefile.in
index 8530f3dcf527..acca8cc4ceb7 100644
--- a/gnulib/Makefile.in
+++ b/gnulib/Makefile.in
@@ -1,7 +1,7 @@
 # Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@

-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.

 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@

 @SET_MAKE@

-# Copyright (C) 2019 Free Software Foundation, Inc.
+# Copyright (C) 2019-2020 Free Software Foundation, Inc.

 # This file is part of GDB.

-- 
2.25.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-13 21:22     ` Simon Marchi
@ 2020-02-13 21:26       ` Pedro Alves
  2020-02-13 21:31         ` Simon Marchi
  0 siblings, 1 reply; 12+ messages in thread
From: Pedro Alves @ 2020-02-13 21:26 UTC (permalink / raw)
  To: Simon Marchi, Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 2/13/20 9:22 PM, Simon Marchi wrote:

> No problem.  Here's the updated patch.
> 
> Given that you have not commented on it, I presume you don't object to renaming these files?

Right, this is fine with me.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdbsupport: rename source files to .cc
  2020-02-13 21:26       ` Pedro Alves
@ 2020-02-13 21:31         ` Simon Marchi
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Marchi @ 2020-02-13 21:31 UTC (permalink / raw)
  To: Pedro Alves, Tom Tromey, Simon Marchi; +Cc: gdb-patches

On 2020-02-13 4:26 p.m., Pedro Alves wrote:
> On 2/13/20 9:22 PM, Simon Marchi wrote:
> 
>> No problem.  Here's the updated patch.
>>
>> Given that you have not commented on it, I presume you don't object to renaming these files?
> 
> Right, this is fine with me.
> 
> Thanks,
> Pedro Alves
> 

Thanks, I have pushed the two patches then.

Simon

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-02-13 21:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 22:54 [PATCH 1/2] gdbsupport: rename source files to .cc Simon Marchi
2020-02-12 22:54 ` [PATCH 2/2] gdbserver: " Simon Marchi
2020-02-13 14:05   ` Tom Tromey
2020-02-13 14:48     ` Simon Marchi
2020-02-13 15:08       ` Tom Tromey
2020-02-13 15:28       ` Aktemur, Tankut Baris
2020-02-13 14:05 ` [PATCH 1/2] gdbsupport: " Tom Tromey
2020-02-13 14:41   ` Simon Marchi
2020-02-13 18:34   ` Pedro Alves
2020-02-13 21:22     ` Simon Marchi
2020-02-13 21:26       ` Pedro Alves
2020-02-13 21:31         ` Simon Marchi

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).