Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@efficios.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 2/2] gdb: remove workarounds for old expat versions
Date: Sun, 11 Oct 2026 09:31:14 -0400	[thread overview]
Message-ID: <20261011133136.472634-2-simon.marchi@efficios.com> (raw)
In-Reply-To: <20261011133136.472634-1-simon.marchi@efficios.com>

gdb_expat.h provides fallback definitions of XML_STATUS_OK,
XML_STATUS_ERROR and XMLCALL for versions that lack them.  xml-support.c
only calls XML_StopParser if configure found it.  These workarounds were
relevant for the Expat 1.95.x versions, which is not relevant anymore
(Expat 2 was released 20 years ago).

Remove AC_CHECK_FUNCS(XML_StopParser) and the conditional in
xml-support.c.

Remove the fallback definitions from gdb_expat.h.

Change-Id: Ia0d0dd692518c190dfb97644be3bb2f3b4082b05
---
 gdb/config.in     |  3 ---
 gdb/configure     | 15 ---------------
 gdb/configure.ac  |  5 -----
 gdb/gdb_expat.h   | 13 -------------
 gdb/xml-support.c |  2 --
 5 files changed, 38 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index 0e5a6637c2b1..8afa32f83e7f 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -628,9 +628,6 @@
 /* Define to 1 if you have the <ws2tcpip.h> header file. */
 #undef HAVE_WS2TCPIP_H
 
-/* Define to 1 if you have the `XML_StopParser' function. */
-#undef HAVE_XML_STOPPARSER
-
 /* Define to 1 if zstd is enabled. */
 #undef HAVE_ZSTD
 
diff --git a/gdb/configure b/gdb/configure
index 810e9ed7a378..9487c2c55001 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -28249,21 +28249,6 @@ $as_echo "$LIBEXPAT" >&6; }
       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: expat is missing or unusable; some features may be unavailable." >&5
 $as_echo "$as_me: WARNING: expat is missing or unusable; some features may be unavailable." >&2;}
     fi
-  else
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBEXPAT"
-    for ac_func in XML_StopParser
-do :
-  ac_fn_c_check_func "$LINENO" "XML_StopParser" "ac_cv_func_XML_StopParser"
-if test "x$ac_cv_func_XML_StopParser" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_XML_STOPPARSER 1
-_ACEOF
-
-fi
-done
-
-    LIBS=$save_LIBS
   fi
 fi
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0d88a280b163..b1f19cb80ee0 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -796,11 +796,6 @@ else
     else
       AC_MSG_WARN([expat is missing or unusable; some features may be unavailable.])
     fi
-  else
-    save_LIBS=$LIBS
-    LIBS="$LIBS $LIBEXPAT"
-    AC_CHECK_FUNCS(XML_StopParser)
-    LIBS=$save_LIBS
   fi
 fi
 
diff --git a/gdb/gdb_expat.h b/gdb/gdb_expat.h
index 756cf81be95c..4b9ed1ac1381 100644
--- a/gdb/gdb_expat.h
+++ b/gdb/gdb_expat.h
@@ -22,19 +22,6 @@
 
 #include <expat.h>
 
-/* Expat 1.95.x does not define these; this is the definition
-   recommended by the expat 2.0 headers.  */
-#ifndef XML_STATUS_OK
-# define XML_STATUS_OK    1
-# define XML_STATUS_ERROR 0
-#endif
-
-/* Old versions of expat do not define this macro, so define it
-   as void.  */
-#ifndef XMLCALL
-#define XMLCALL
-#endif
-
 /* Return the line number of PARSER's current position.
 
    Expat 2.9.0 deprecates XML_GetCurrentLineNumber in favor of
diff --git a/gdb/xml-support.c b/gdb/xml-support.c
index 7d86dbb8c698..0e33ce54d12e 100644
--- a/gdb/xml-support.c
+++ b/gdb/xml-support.c
@@ -117,9 +117,7 @@ struct gdb_xml_parser
   void set_error (gdb_exception &&error)
   {
     m_error = std::move (error);
-#ifdef HAVE_XML_STOPPARSER
     XML_StopParser (m_expat_parser, XML_FALSE);
-#endif
   }
 
   /* Return the underlying expat parser.  */
-- 
2.56.0


  reply	other threads:[~2026-10-11 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 13:31 [PATCH 1/2] gdb: use XML_GetCurrentLineNumber64 with expat >= 2.9.0 Simon Marchi
2026-10-11 13:31 ` Simon Marchi [this message]
2026-10-13  9:23 ` Tom de Vries
2026-10-13 14:54   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261011133136.472634-2-simon.marchi@efficios.com \
    --to=simon.marchi@efficios.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox