]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't require "Bss=" in qOffsets response
authorTom Tromey <tromey@adacore.com>
Thu, 4 Sep 2025 15:33:07 +0000 (09:33 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 4 Sep 2025 20:39:32 +0000 (14:39 -0600)
The "Bss=" part of the qOffsets response is documented as being
optional, but gdb in fact requires it.  This patch fixes the bug.

I couldn't find a straightforward way to test this.  gdbserver does
send 'Bss=' -- but this code is only enabled for a fairly specific
setup:

    #if (defined(__UCLIBC__) \
 && defined(HAS_NOMMU) \
 && defined(PT_TEXT_ADDR) \
 && defined(PT_DATA_ADDR) \
 && defined(PT_TEXT_END_ADDR))
    #define SUPPORTS_READ_OFFSETS
    #endif

I also considered changing gdbserver to not send Bss=, but decided
against this, reasoning that we may as well not break compatibility
with older versions of gdb.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33319
Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/remote.c

index fb1e88ae67842e8562e5c6a6542a2815b20ad445..1d8d9b10339a96586a46a6172576a12ddd8f0d57 100644 (file)
@@ -4669,8 +4669,6 @@ remote_target::get_offsets ()
          if (bss_addr != data_addr)
            warning (_("Target reported unsupported offsets: %s"), buf);
        }
-      else
-       lose = 1;
     }
   else if (startswith (ptr, "TextSeg="))
     {