public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Change gdbserver to use existing gdbsupport
@ 2020-02-25 22:22 Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Tom Tromey
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches

Here's v2 of the patch to change gdbserver to use the existing
gdbsupport, rather than building its own copy.  I've split the patch
into two parts, as requested, and added some more patches as well --
since as Pedro pointed out, some builds were broken in the old patch.

I built this for x86-64, x86, and mingw32.  I also confirmed that the
resulting gdbserver.exe will start up under wine.

Tom


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

* [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-03-11  3:38   ` Simon Marchi
  2020-02-25 22:22 ` [PATCH v2 6/6] Change gdbserver to use existing gdbsupport Tom Tromey
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Some arm-tdep.c data structures use a bfd_vma.  A couple of spots will
warn about an implicit narrowing cast when building a gdb where
CORE_ADDR is 64-bit but bfd_vma is 32-bit.

This patch silences these warnings by introducing an explicit cast.
This seemed both simplest and correct.

2020-02-25  Tom Tromey  <tom@tromey.com>

	* arm-tdep.c (map_key, arm_find_exidx_entry): Cast to bfd_vma.
---
 gdb/ChangeLog  | 4 ++++
 gdb/arm-tdep.c | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 175c5b956e7..d395c7f7b75 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -366,7 +366,7 @@ arm_find_mapping_symbol (CORE_ADDR memaddr, CORE_ADDR *start)
 	    }
 
 	  struct arm_mapping_symbol map_key
-	    = { memaddr - obj_section_addr (sec), 0 };
+	    = { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 };
 	  arm_mapping_symbol_vec::const_iterator it
 	    = std::lower_bound (map.begin (), map.end (), map_key);
 
@@ -2246,7 +2246,8 @@ arm_find_exidx_entry (CORE_ADDR memaddr, CORE_ADDR *start)
   if (sec != NULL)
     {
       struct arm_exidx_data *data;
-      struct arm_exidx_entry map_key = { memaddr - obj_section_addr (sec), 0 };
+      struct arm_exidx_entry map_key
+	= { (bfd_vma) (memaddr - obj_section_addr (sec)), 0 };
 
       data = arm_exidx_data_key.get (sec->objfile->obfd);
       if (data != NULL)
-- 
2.17.2

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

* [PATCH v2 6/6] Change gdbserver to use existing gdbsupport
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 5/6] Change gdbsupport not to rely on BFD Tom Tromey
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes the gdbserver build to use the gdbsupport that was built
for gdb.

gdbserver and gdbreplay now must use WIN32APILIBS (aka -lws2_32).
Before this change, gdbserver did not define USE_WIN32API when
building gdbsupport, but now this is always done.

2020-02-25  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Rebuild.
	* Makefile.def (gdbserver): Depend on gdbsupport.

gdbserver/ChangeLog
2020-02-25  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac (GDBSERVER_DEPFILES): Remove srv_selftest_objs.
	(WIN32APILIBS): New subst.
	* Makefile.in (SFILES, OBS, TAGS, GDBREPLAY_OBS): Remove
	gdbsupport files.
	(gdbsupport/%.o): Remove target.
	(GDBSUPPORT_BUILDDIR, GDBSUPPORT): New variables.
	(gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Add GDBSUPPORT.
	(WIN32APILIBS): New variable.
	(gdbserver$(EXEEXT)): Add WIN32APILIBS.
	(gdbreplay$(EXEEXT)): Likewise.
---
 ChangeLog              |  5 +++
 Makefile.def           |  1 +
 Makefile.in            |  1 +
 gdbserver/ChangeLog    | 14 +++++++
 gdbserver/Makefile.in  | 88 +++++++-----------------------------------
 gdbserver/configure    |  7 ++--
 gdbserver/configure.ac |  8 ++--
 7 files changed, 42 insertions(+), 82 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 3162199ac7b..76d062bb671 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -412,6 +412,7 @@ dependencies = { module=all-gdb; on=all-libctf; };
 
 // Host modules specific to gdbserver.
 dependencies = { module=configure-gdbserver; on=all-gnulib; };
+dependencies = { module=all-gdbserver; on=all-gdbsupport; };
 dependencies = { module=all-gdbserver; on=all-gnulib; };
 dependencies = { module=all-gdbserver; on=all-libiberty; };
 
diff --git a/Makefile.in b/Makefile.in
index d24dfdfb860..9dfd39fae13 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -51977,6 +51977,7 @@ all-gdb: maybe-all-build-bison
 all-gdb: maybe-all-sim
 all-gdb: maybe-all-libtermcap
 configure-gdbserver: maybe-all-gnulib
+all-gdbserver: maybe-all-gdbsupport
 all-gdbserver: maybe-all-gnulib
 configure-libgui: maybe-configure-tcl
 configure-libgui: maybe-configure-tk
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index d6b79385e15..8c35c169d62 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -102,6 +102,9 @@ INCLUDE_DEP = $$(INCLUDE_DIR)
 LIBIBERTY_BUILDDIR = ../libiberty
 LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
 
+GDBSUPPORT_BUILDDIR = ../gdbsupport
+GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a
+
 # Where is ust?  These will be empty if ust was not available.
 ustlibs = @ustlibs@
 ustinc = @ustinc@
@@ -152,6 +155,8 @@ CPPFLAGS = @CPPFLAGS@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PTHREAD_LIBS = @PTHREAD_LIBS@
 
+WIN32APILIBS = @WIN32APILIBS@
+
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
 INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
 	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
@@ -213,32 +218,6 @@ SFILES = \
 	$(srcdir)/../gdb/arch/arm-linux.c \
 	$(srcdir)/../gdb/arch/ppc-linux-common.c \
 	$(srcdir)/../gdb/arch/riscv.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 \
@@ -260,36 +239,6 @@ TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
 OBS = \
 	alloc.o \
 	ax.o \
-	gdbsupport/agent.o \
-	gdbsupport/btrace-common.o \
-	gdbsupport/buffer.o \
-	gdbsupport/cleanups.o \
-	gdbsupport/common-debug.o \
-	gdbsupport/common-exceptions.o \
-	gdbsupport/common-inferior.o \
-	gdbsupport/job-control.o \
-	gdbsupport/common-regcache.o \
-	gdbsupport/common-utils.o \
-	gdbsupport/errors.o \
-	gdbsupport/environ.o \
-	gdbsupport/fileio.o \
-	gdbsupport/filestuff.o \
-	gdbsupport/format.o \
-	gdbsupport/gdb-dlfcn.o \
-	gdbsupport/gdb_tilde_expand.o \
-	gdbsupport/gdb_vecs.o \
-	gdbsupport/gdb_wait.o \
-	gdbsupport/netstuff.o \
-	gdbsupport/new-op.o \
-	gdbsupport/pathstuff.o \
-	gdbsupport/print-utils.o \
-	gdbsupport/ptid.o \
-	gdbsupport/rsp-low.o \
-	gdbsupport/safe-strerror.o \
-	gdbsupport/signals.o \
-	gdbsupport/signals-state-save-restore.o \
-	gdbsupport/tdesc.o \
-	gdbsupport/xml-utils.o \
 	debug.o \
 	dll.o \
 	event-loop.o \
@@ -312,14 +261,6 @@ OBS = \
 	$(XML_BUILTIN)
 
 GDBREPLAY_OBS = \
-	gdbsupport/cleanups.o \
-	gdbsupport/common-exceptions.o \
-	gdbsupport/common-utils.o \
-	gdbsupport/rsp-low.o \
-	gdbsupport/errors.o \
-	gdbsupport/netstuff.o \
-	gdbsupport/print-utils.o \
-	gdbsupport/safe-strerror.o \
 	gdbreplay.o \
 	utils.o \
 	version.o
@@ -412,18 +353,20 @@ install-html:
 clean-info:
 
 gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
-		$(INTL_DEPS)
+		$(INTL_DEPS) $(GDBSUPPORT)
 	$(SILENCE) rm -f gdbserver$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
-		-o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
-		$(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS)
+		-o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
+		$(LIBIBERTY) $(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS) \
+		$(WIN32APILIBS)
 
 gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
-		$(INTL_DEPS)
+		$(INTL_DEPS) $(GDBSUPPORT)
 	$(SILENCE) rm -f gdbreplay$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
-		-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
-		$(LIBIBERTY) $(INTL)
+		-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
+		$(GDBSUPPORT) $(LIBGNU) $(LIBIBERTY) $(INTL) \
+		$(WIN32APILIBS)
 
 IPA_OBJS = \
 	alloc-ipa.o \
@@ -459,7 +402,6 @@ TAGS:	${TAGFILES}
 	     if [ x$$i != xyzzy ]; then \
 	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
 		 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
-		 -e 's,/\(gdbsupport\)/,/../../\1/,'; \
 	     fi; \
 	   done` \
 	  ${TAGFILES}
@@ -595,10 +537,6 @@ arch/%.o: ../gdb/arch/%.c
 	$(COMPILE) -x c++ $<
 	$(POSTCOMPILE)
 
-gdbsupport/%.o: ../gdbsupport/%.cc
-	$(COMPILE) $<
-	$(POSTCOMPILE)
-
 %.o: %-generated.cc
 	$(COMPILE) $<
 	$(POSTCOMPILE)
diff --git a/gdbserver/configure b/gdbserver/configure
index 47f3152eb45..57b5dedfff6 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -637,6 +637,7 @@ WERROR_CFLAGS
 WARN_CFLAGS
 ustinc
 ustlibs
+WIN32APILIBS
 LTLIBIPT
 LIBIPT
 HAVE_LIBIPT
@@ -6112,8 +6113,6 @@ if $enable_unittests; then
 $as_echo "#define GDB_SELF_TEST 1" >>confdefs.h
 
 
-  srv_selftest_objs="gdbsupport/selftest.o"
-
 fi
 
 
@@ -9379,6 +9378,8 @@ $as_echo "$bfd_cv_have_sys_procfs_type_elf_fpregset_t" >&6; }
 
   fi
 
+# This is set by GDB_AC_COMMON.
+
 
 # Check the return and argument types of ptrace.
 
@@ -10626,7 +10627,7 @@ $as_echo "#define USE_XML 1" >>confdefs.h
   done
 fi
 
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
 GDBSERVER_LIBS="$srv_libs"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the target supports __sync_*_compare_and_swap" >&5
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index d0f406628d9..0556f7dba75 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -46,9 +46,7 @@ AC_HEADER_STDC
 # Set the 'development' global.
 . $srcdir/../bfd/development.sh
 
-GDB_AC_SELFTEST([
-  srv_selftest_objs="gdbsupport/selftest.o"
-])
+GDB_AC_SELFTEST
 
 ACX_NONCANONICAL_TARGET
 ACX_NONCANONICAL_HOST
@@ -81,6 +79,8 @@ AC_FUNC_FORK
 AC_CHECK_FUNCS(pread pwrite pread64)
 
 GDB_AC_COMMON
+# This is set by GDB_AC_COMMON.
+AC_SUBST(WIN32APILIBS)
 
 # Check the return and argument types of ptrace.
 GDB_AC_PTRACE
@@ -360,7 +360,7 @@ if test "$srv_xmlfiles" != ""; then
   done
 fi
 
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles $srv_selftest_objs"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
 GDBSERVER_LIBS="$srv_libs"
 
 dnl Check whether the target supports __sync_*_compare_and_swap.
-- 
2.17.2

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

* [PATCH v2 2/6] Don't use sprintf_vma for CORE_ADDR
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
                   ` (4 preceding siblings ...)
  2020-02-25 22:22 ` [PATCH v2 4/6] Fix gdbserver build when intl already built Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-03-11  0:30 ` [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

A few spots in gdb use sprintf_vma to print a CORE_ADDR.  This will
fail on a 32-bit build once CORE_ADDR is always a 64-bit type.

This patch replaces these calls with phex instead.

2020-02-25  Tom Tromey  <tom@tromey.com>

	* remote.c (remote_target::download_tracepoint)
	(remote_target::enable_tracepoint)
	(remote_target::disable_tracepoint): Use phex, not sprintf_vma.
	* breakpoint.c (print_recreate_masked_watchpoint): Use phex, not
	sprintf_vma.
---
 gdb/ChangeLog    |  8 ++++++++
 gdb/breakpoint.c |  5 ++---
 gdb/remote.c     | 12 +++++-------
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 5a9352c26fe..e49025461ba 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -10400,7 +10400,6 @@ static void
 print_recreate_masked_watchpoint (struct breakpoint *b, struct ui_file *fp)
 {
   struct watchpoint *w = (struct watchpoint *) b;
-  char tmp[40];
 
   switch (b->type)
     {
@@ -10418,8 +10417,8 @@ print_recreate_masked_watchpoint (struct breakpoint *b, struct ui_file *fp)
 		      _("Invalid hardware watchpoint type."));
     }
 
-  sprintf_vma (tmp, w->hw_wp_mask);
-  fprintf_unfiltered (fp, " %s mask 0x%s", w->exp_string, tmp);
+  fprintf_unfiltered (fp, " %s mask 0x%s", w->exp_string,
+		      phex (w->hw_wp_mask, sizeof (CORE_ADDR)));
   print_recreate_thread (b, fp);
 }
 
diff --git a/gdb/remote.c b/gdb/remote.c
index 4a70ab3fb0d..026cedcbbdc 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -12814,7 +12814,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
   encode_actions_rsp (loc, &tdp_actions, &stepping_actions);
 
   tpaddr = loc->address;
-  sprintf_vma (addrbuf, tpaddr);
+  strcpy (addrbuf, phex (tpaddr, sizeof (CORE_ADDR)));
   ret = snprintf (buf.data (), buf.size (), "QTDP:%x:%s:%c:%lx:%x",
 		  b->number, addrbuf, /* address */
 		  (b->enable_state == bp_enabled ? 'E' : 'D'),
@@ -13076,11 +13076,10 @@ void
 remote_target::enable_tracepoint (struct bp_location *location)
 {
   struct remote_state *rs = get_remote_state ();
-  char addr_buf[40];
 
-  sprintf_vma (addr_buf, location->address);
   xsnprintf (rs->buf.data (), get_remote_packet_size (), "QTEnable:%x:%s",
-	     location->owner->number, addr_buf);
+	     location->owner->number,
+	     phex (location->address, sizeof (CORE_ADDR)));
   putpkt (rs->buf);
   remote_get_noisy_reply ();
   if (rs->buf[0] == '\0')
@@ -13093,11 +13092,10 @@ void
 remote_target::disable_tracepoint (struct bp_location *location)
 {
   struct remote_state *rs = get_remote_state ();
-  char addr_buf[40];
 
-  sprintf_vma (addr_buf, location->address);
   xsnprintf (rs->buf.data (), get_remote_packet_size (), "QTDisable:%x:%s",
-	     location->owner->number, addr_buf);
+	     location->owner->number,
+	     phex (location->address, sizeof (CORE_ADDR)));
   putpkt (rs->buf);
   remote_get_noisy_reply ();
   if (rs->buf[0] == '\0')
-- 
2.17.2

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

* [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Tom Tromey
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

symfile-mem.c has some assertions about the size of various types, to
ensure that gdb and BFD don't get out of sync in a way that would
cause bugs.

Once CORE_ADDR is always 64-bit, one of these assertions can fail for
a 32-bit BFD build.  However, the real requirement here is just that
CORE_ADDR is wider -- because this code promotes a bfd_vma to a
CORE_ADDR.

This patch corrects the assert.

gdb/ChangeLog
2020-02-25  Tom Tromey  <tom@tromey.com>

	* symfile-mem.c: Update CORE_ADDR size assert.
---
 gdb/ChangeLog     | 4 ++++
 gdb/symfile-mem.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c
index a62d0d0c8f4..e2d2e43d7fa 100644
--- a/gdb/symfile-mem.c
+++ b/gdb/symfile-mem.c
@@ -57,7 +57,7 @@
 /* Verify parameters of target_read_memory_bfd and target_read_memory are
    compatible.  */
 
-gdb_static_assert (sizeof (CORE_ADDR) == sizeof (bfd_vma));
+gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (bfd_vma));
 gdb_static_assert (sizeof (gdb_byte) == sizeof (bfd_byte));
 gdb_static_assert (sizeof (ssize_t) <= sizeof (bfd_size_type));
 
-- 
2.17.2

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

* [PATCH v2 5/6] Change gdbsupport not to rely on BFD
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
                   ` (2 preceding siblings ...)
  2020-02-25 22:22 ` [PATCH v2 6/6] Change gdbserver to use existing gdbsupport Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 4/6] Fix gdbserver build when intl already built Tom Tromey
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes gdbsupport so that it no longer relies on BFD.  This is a
precursor to making gdbserver use the already-built gdbsupport,
because building gdbserver should not require BFD to be built.

The most notable change here is that CORE_ADDR is always a 64-bit
type.  This makes it so that gdb acts as if it were always built in
64-bit mode.

ChangeLog
2020-02-25  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Rebuild.
	* Makefile.def (gdbsupport): Don't depend on bfd.

gdbsupport/ChangeLog
2020-02-25  Tom Tromey  <tom@tromey.com>

	* common-types.h: Remove GDBSERVER code.
	(gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Redefine.
	* common-defs.h: Remove GDBSERVER code.
---
 ChangeLog                 |  5 +++++
 Makefile.def              |  2 --
 Makefile.in               |  2 --
 gdbsupport/ChangeLog      |  6 ++++++
 gdbsupport/common-defs.h  | 16 ----------------
 gdbsupport/common-types.h | 32 +++++---------------------------
 6 files changed, 16 insertions(+), 47 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 7a27220d77a..3162199ac7b 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -421,10 +421,8 @@ dependencies = { module=all-libgui; on=all-tcl; };
 dependencies = { module=all-libgui; on=all-tk; };
 dependencies = { module=all-libgui; on=all-itcl; };
 
-dependencies = { module=configure-gdbsupport; on=configure-bfd; };
 dependencies = { module=configure-gdbsupport; on=configure-gnulib; };
 dependencies = { module=configure-gdbsupport; on=configure-intl; };
-dependencies = { module=all-gdbsupport; on=all-bfd; };
 dependencies = { module=all-gdbsupport; on=all-gnulib; };
 dependencies = { module=all-gdbsupport; on=all-intl; };
 
diff --git a/Makefile.in b/Makefile.in
index e09bb1d311f..d24dfdfb860 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52454,9 +52454,7 @@ all-gdb: maybe-all-opcodes
 all-gdb: maybe-all-libdecnumber
 all-gdb: maybe-all-libctf
 all-gdbserver: maybe-all-libiberty
-configure-gdbsupport: maybe-configure-bfd
 configure-gdbsupport: maybe-configure-intl
-all-gdbsupport: maybe-all-bfd
 all-gdbsupport: maybe-all-intl
 configure-gprof: maybe-configure-intl
 all-gprof: maybe-all-libiberty
diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h
index a5c57de2f27..65500ce7634 100644
--- a/gdbsupport/common-defs.h
+++ b/gdbsupport/common-defs.h
@@ -20,20 +20,6 @@
 #ifndef COMMON_COMMON_DEFS_H
 #define COMMON_COMMON_DEFS_H
 
-#ifdef GDBSERVER
-
-#include <gnulib/config.h>
-
-#undef PACKAGE_NAME
-#undef PACKAGE
-#undef PACKAGE_VERSION
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-
-#include <config.h>
-
-#else  /* GDBSERVER */
-
 #include <gdbsupport/config.h>
 
 #undef PACKAGE_NAME
@@ -44,8 +30,6 @@
 
 #include "gnulib/config.h"
 
-#endif	/* GDBSERVER */
-
 /* From:
     https://www.gnu.org/software/gnulib/manual/html_node/stdint_002eh.html
 
diff --git a/gdbsupport/common-types.h b/gdbsupport/common-types.h
index 61099b4e25d..f5b2f3d2491 100644
--- a/gdbsupport/common-types.h
+++ b/gdbsupport/common-types.h
@@ -20,40 +20,18 @@
 #ifndef COMMON_COMMON_TYPES_H
 #define COMMON_COMMON_TYPES_H
 
-#ifdef GDBSERVER
+#include <inttypes.h>
 
 /* * A byte from the program being debugged.  */
 typedef unsigned char gdb_byte;
 
-typedef unsigned long long CORE_ADDR;
-
-typedef long long LONGEST;
-typedef unsigned long long ULONGEST;
-
-#else /* GDBSERVER */
-
-#include "bfd.h"
-
-/* * A byte from the program being debugged.  */
-typedef bfd_byte gdb_byte;
-
 /* * An address in the program being debugged.  Host byte order.  */
-typedef bfd_vma CORE_ADDR;
-
-/* This is to make sure that LONGEST is at least as big as CORE_ADDR.  */
-
-#ifdef BFD64
-
-typedef BFD_HOST_64_BIT LONGEST;
-typedef BFD_HOST_U_64_BIT ULONGEST;
-
-#else /* No BFD64 */
+typedef uint64_t CORE_ADDR;
 
-typedef long long LONGEST;
-typedef unsigned long long ULONGEST;
+/* LONGEST must be at least as big as CORE_ADDR.  */
 
-#endif /* No BFD64 */
-#endif /* GDBSERVER */
+typedef int64_t LONGEST;
+typedef uint64_t ULONGEST;
 
 /* * The largest CORE_ADDR value.  */
 #define CORE_ADDR_MAX (~(CORE_ADDR) 0)
-- 
2.17.2

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

* [PATCH v2 4/6] Fix gdbserver build when intl already built
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
                   ` (3 preceding siblings ...)
  2020-02-25 22:22 ` [PATCH v2 5/6] Change gdbsupport not to rely on BFD Tom Tromey
@ 2020-02-25 22:22 ` Tom Tromey
  2020-02-25 22:22 ` [PATCH v2 2/6] Don't use sprintf_vma for CORE_ADDR Tom Tromey
  2020-03-11  0:30 ` [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-02-25 22:22 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

gdbserver uses gdb's alloc.c, and this in turn can include headers
from intl via gdbsupport/gdb_locale.h.  This can cause build failures
in some situations, for example if you build gdb and gdbserver on
mingw.

This patch restores the gdbsupport dependency on intl, and changes
gdbserver to use ZW_GNU_GETTEXT_SISTER_DIR.  This fixes this build
problem.

2020-02-25  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Rebuild.
	* Makefile.def (gdbsupport): Depend on intl.

gdbserver/ChangeLog
2020-02-25  Tom Tromey  <tom@tromey.com>

	* config.in, configure: Rebuild.
	* configure.ac: Call ZW_GNU_GETTEXT_SISTER_DIR.
	* acinclude.m4: Include gettext-sister.m4.
	* Makefile.in (top_builddir, INTL, INTL_DEPS, INTL_CFLAGS): New
	variables.
	(INCLUDE_CFLAGS): Add INTL_CFLAGS.
	(gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Use INTL_DEPS, INTL.
---
 ChangeLog              |  5 +++
 Makefile.def           |  2 +
 Makefile.in            |  2 +
 gdbserver/ChangeLog    | 10 +++++
 gdbserver/Makefile.in  | 20 +++++++---
 gdbserver/acinclude.m4 |  3 ++
 gdbserver/config.in    |  4 ++
 gdbserver/configure    | 83 ++++++++++++++++++++++++++++++++++++++++++
 gdbserver/configure.ac |  3 ++
 9 files changed, 127 insertions(+), 5 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 2fe8204366c..7a27220d77a 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -423,8 +423,10 @@ dependencies = { module=all-libgui; on=all-itcl; };
 
 dependencies = { module=configure-gdbsupport; on=configure-bfd; };
 dependencies = { module=configure-gdbsupport; on=configure-gnulib; };
+dependencies = { module=configure-gdbsupport; on=configure-intl; };
 dependencies = { module=all-gdbsupport; on=all-bfd; };
 dependencies = { module=all-gdbsupport; on=all-gnulib; };
+dependencies = { module=all-gdbsupport; on=all-intl; };
 
 // Host modules specific to binutils.
 dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
diff --git a/Makefile.in b/Makefile.in
index be38b34e9bf..e09bb1d311f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -52455,7 +52455,9 @@ all-gdb: maybe-all-libdecnumber
 all-gdb: maybe-all-libctf
 all-gdbserver: maybe-all-libiberty
 configure-gdbsupport: maybe-configure-bfd
+configure-gdbsupport: maybe-configure-intl
 all-gdbsupport: maybe-all-bfd
+all-gdbsupport: maybe-all-intl
 configure-gprof: maybe-configure-intl
 all-gprof: maybe-all-libiberty
 all-gprof: maybe-all-bfd
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index cc1eb808e32..d6b79385e15 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -75,6 +75,8 @@ abs_top_srcdir = @abs_top_srcdir@
 abs_srcdir = @abs_srcdir@
 VPATH = @srcdir@
 
+top_builddir = .
+
 include $(srcdir)/../gdb/silent-rules.mk
 
 # Note that these are overridden by GNU make-specific code below if
@@ -109,6 +111,11 @@ GNULIB_BUILDDIR = ../gnulib
 LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
 INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
 
+# Where is the INTL library?  Typically in ../intl.
+INTL = @LIBINTL@
+INTL_DEPS = @LIBINTL_DEP@
+INTL_CFLAGS = @INCINTL@
+
 INCSUPPORT = -I$(srcdir)/.. -I..
 
 # All the includes used for CFLAGS and for lint.
@@ -122,7 +129,8 @@ INCSUPPORT = -I$(srcdir)/.. -I..
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
 	-I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
-	-I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT)
+	-I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \
+	$(INTL_CFLAGS)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -403,17 +411,19 @@ html:
 install-html:
 clean-info:
 
-gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
+gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
+		$(INTL_DEPS)
 	$(SILENCE) rm -f gdbserver$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
 		-o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
-		$(GDBSERVER_LIBS) $(XM_CLIBS)
+		$(INTL) $(GDBSERVER_LIBS) $(XM_CLIBS)
 
-gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
+gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
+		$(INTL_DEPS)
 	$(SILENCE) rm -f gdbreplay$(EXEEXT)
 	$(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
 		-o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
-		$(LIBIBERTY)
+		$(LIBIBERTY) $(INTL)
 
 IPA_OBJS = \
 	alloc-ipa.o \
diff --git a/gdbserver/acinclude.m4 b/gdbserver/acinclude.m4
index 00476bb0553..fb6837d6aa9 100644
--- a/gdbserver/acinclude.m4
+++ b/gdbserver/acinclude.m4
@@ -36,6 +36,9 @@ m4_include(../gdb/selftest.m4)
 
 m4_include([../config/ax_pthread.m4])
 
+dnl For ZW_GNU_GETTEXT_SISTER_DIR.
+m4_include(../config/gettext-sister.m4)
+
 dnl Check for existence of a type $1 in libthread_db.h
 dnl Based on BFD_HAVE_SYS_PROCFS_TYPE in bfd/bfd.m4.
 
diff --git a/gdbserver/config.in b/gdbserver/config.in
index da8c313c360..e62795072f2 100644
--- a/gdbserver/config.in
+++ b/gdbserver/config.in
@@ -11,6 +11,10 @@
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
 
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
 /* Define if self-testing features should be enabled */
 #undef GDB_SELF_TEST
 
diff --git a/gdbserver/configure b/gdbserver/configure
index be5719eb77a..47f3152eb45 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -648,6 +648,18 @@ SED
 ALLOCA
 CCDEPMODE
 CONFIG_SRC_SUBDIR
+CATOBJEXT
+GENCAT
+INSTOBJEXT
+DATADIRNAME
+CATALOGS
+POSUB
+GMSGFMT
+XGETTEXT
+INCINTL
+LIBINTL_DEP
+LIBINTL
+USE_NLS
 DEPDIR
 am__leading_dot
 host_noncanonical
@@ -6141,6 +6153,77 @@ ac_config_commands="$ac_config_commands depdir"
 
 
 
+# If we haven't got the data from the intl directory,
+# assume NLS is disabled.
+USE_NLS=no
+LIBINTL=
+LIBINTL_DEP=
+INCINTL=
+XGETTEXT=
+GMSGFMT=
+POSUB=
+
+if test -f  ../intl/config.intl; then
+  .  ../intl/config.intl
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+if test x"$USE_NLS" != xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5
+$as_echo_n "checking for catalogs to be installed... " >&6; }
+  # Look for .po and .gmo files in the source directory.
+  CATALOGS=
+  XLINGUAS=
+  for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
+    # If there aren't any .gmo files the shell will give us the
+    # literal string "../path/to/srcdir/po/*.gmo" which has to be
+    # weeded out.
+    case "$cat" in *\**)
+      continue;;
+    esac
+    # The quadruple backslash is collapsed to a double backslash
+    # by the backticks, then collapsed again by the double quotes,
+    # leaving us with one backslash in the sed expression (right
+    # before the dot that mustn't act as a wildcard).
+    cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"`
+    lang=`echo $cat | sed -e "s!\\\\.gmo!!"`
+    # The user is allowed to set LINGUAS to a list of languages to
+    # install catalogs for.  If it's empty that means "all of them."
+    if test "x$LINGUAS" = x; then
+      CATALOGS="$CATALOGS $cat"
+      XLINGUAS="$XLINGUAS $lang"
+    else
+      case "$LINGUAS" in *$lang*)
+        CATALOGS="$CATALOGS $cat"
+        XLINGUAS="$XLINGUAS $lang"
+        ;;
+      esac
+    fi
+  done
+  LINGUAS="$XLINGUAS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5
+$as_echo "$LINGUAS" >&6; }
+
+
+    DATADIRNAME=share
+
+  INSTOBJEXT=.mo
+
+  GENCAT=gencat
+
+  CATOBJEXT=.gmo
+
+fi
+
 # Create sub-directories for objects and dependencies.
 CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
 
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index be2284b26c5..d0f406628d9 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -56,6 +56,9 @@ ACX_NONCANONICAL_HOST
 # Dependency checking.
 ZW_CREATE_DEPDIR
 
+dnl Set up for gettext.
+ZW_GNU_GETTEXT_SISTER_DIR
+
 # Create sub-directories for objects and dependencies.
 CONFIG_SRC_SUBDIR="arch gdbsupport nat target"
 AC_SUBST(CONFIG_SRC_SUBDIR)
-- 
2.17.2

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

* Re: [PATCH v2 0/6] Change gdbserver to use existing gdbsupport
  2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
                   ` (5 preceding siblings ...)
  2020-02-25 22:22 ` [PATCH v2 2/6] Don't use sprintf_vma for CORE_ADDR Tom Tromey
@ 2020-03-11  0:30 ` Tom Tromey
  6 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-03-11  0:30 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> Here's v2 of the patch to change gdbserver to use the existing
Tom> gdbsupport, rather than building its own copy.  I've split the patch
Tom> into two parts, as requested, and added some more patches as well --
Tom> since as Pedro pointed out, some builds were broken in the old patch.

Tom> I built this for x86-64, x86, and mingw32.  I also confirmed that the
Tom> resulting gdbserver.exe will start up under wine.

I'm planning to check this in soon, so if you have any comments, this
would be a good time.

Tom

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

* Re: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
  2020-02-25 22:22 ` [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Tom Tromey
@ 2020-03-11  3:38   ` Simon Marchi
  2020-03-12 17:58     ` Tom Tromey
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Marchi @ 2020-03-11  3:38 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 2020-02-25 5:22 p.m., Tom Tromey wrote:
> Some arm-tdep.c data structures use a bfd_vma.  A couple of spots will
> warn about an implicit narrowing cast when building a gdb where
> CORE_ADDR is 64-bit but bfd_vma is 32-bit.
> 
> This patch silences these warnings by introducing an explicit cast.
> This seemed both simplest and correct.

Did you consider changing arm_mapping_symbol::value to be a CORE_ADDR?  It would
seem even simpler and safe to me.

Simon

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

* Re: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
  2020-03-11  3:38   ` Simon Marchi
@ 2020-03-12 17:58     ` Tom Tromey
  2020-03-12 18:05       ` Simon Marchi
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2020-03-12 17:58 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

Simon> Did you consider changing arm_mapping_symbol::value to be a
Simon> CORE_ADDR?  It would seem even simpler and safe to me.

For some reason I thought this was harder, but I tried it and it is
fine.  Here's the updated patch.

Tom

commit a01a37e95dc6927020783184eff1c82660b1cbf5
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Mar 10 16:09:37 2020 -0600

    Cast to bfd_vma in arm-tdep.c
    
    Some arm-tdep.c data structures use a bfd_vma.  A couple of spots will
    warn about an implicit narrowing cast when building a gdb where
    CORE_ADDR is 64-bit but bfd_vma is 32-bit.
    
    This patch silences these warnings by changing the types in question
    to CORE_ADDR.
    
    gdb/ChangeLog
    2020-03-10  Tom Tromey  <tom@tromey.com>
    
            * arm-tdep.c (struct arm_mapping_symbol) <value>: Now a
            CORE_ADDR.
            (struct arm_exidx_entry) <addr>: Now a CORE_ADDR.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 86bbcaaa39f..280cf03a6a6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-10  Tom Tromey  <tom@tromey.com>
+
+	* arm-tdep.c (struct arm_mapping_symbol) <value>: Now a
+	CORE_ADDR.
+	(struct arm_exidx_entry) <addr>: Now a CORE_ADDR.
+
 2020-03-10  Tom Tromey  <tom@tromey.com>
 
 	* remote.c (remote_target::download_tracepoint)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 175c5b956e7..44c439a85f5 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -81,7 +81,7 @@ static bool arm_debug;
 
 struct arm_mapping_symbol
 {
-  bfd_vma value;
+  CORE_ADDR value;
   char type;
 
   bool operator< (const arm_mapping_symbol &other) const
@@ -1986,7 +1986,7 @@ struct frame_unwind arm_prologue_unwind = {
 
 struct arm_exidx_entry
 {
-  bfd_vma addr;
+  CORE_ADDR addr;
   gdb_byte *entry;
 
   bool operator< (const arm_exidx_entry &other) const

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

* Re: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
  2020-03-12 17:58     ` Tom Tromey
@ 2020-03-12 18:05       ` Simon Marchi
  2020-03-12 19:35         ` Tom Tromey
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Marchi @ 2020-03-12 18:05 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2020-03-12 1:58 p.m., Tom Tromey wrote:
> Simon> Did you consider changing arm_mapping_symbol::value to be a
> Simon> CORE_ADDR?  It would seem even simpler and safe to me.
> 
> For some reason I thought this was harder, but I tried it and it is
> fine.  Here's the updated patch.
> 
> Tom

Nice, thanks.

The series LGTM otherwise.

Simon

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

* Re: [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c
  2020-03-12 18:05       ` Simon Marchi
@ 2020-03-12 19:35         ` Tom Tromey
  0 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2020-03-12 19:35 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Tom Tromey, gdb-patches

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

Simon> The series LGTM otherwise.

Thanks.  I'm going to check it in now.

Tom

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

end of thread, other threads:[~2020-03-12 19:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 22:22 [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey
2020-02-25 22:22 ` [PATCH v2 1/6] Fix CORE_ADDR size assertion in symfile-mem.c Tom Tromey
2020-02-25 22:22 ` [PATCH v2 3/6] Cast to bfd_vma in arm-tdep.c Tom Tromey
2020-03-11  3:38   ` Simon Marchi
2020-03-12 17:58     ` Tom Tromey
2020-03-12 18:05       ` Simon Marchi
2020-03-12 19:35         ` Tom Tromey
2020-02-25 22:22 ` [PATCH v2 6/6] Change gdbserver to use existing gdbsupport Tom Tromey
2020-02-25 22:22 ` [PATCH v2 5/6] Change gdbsupport not to rely on BFD Tom Tromey
2020-02-25 22:22 ` [PATCH v2 4/6] Fix gdbserver build when intl already built Tom Tromey
2020-02-25 22:22 ` [PATCH v2 2/6] Don't use sprintf_vma for CORE_ADDR Tom Tromey
2020-03-11  0:30 ` [PATCH v2 0/6] Change gdbserver to use existing gdbsupport Tom Tromey

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