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
