]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: Update require_int function to parse offset for pread packet
authorKirill Radkin <kirill.radkin@syntacore.com>
Tue, 3 Jun 2025 13:48:23 +0000 (16:48 +0300)
committerPedro Alves <pedro@palves.net>
Fri, 20 Jun 2025 14:17:24 +0000 (15:17 +0100)
commitba4bedeafa1cd9361b49a11dcd0e4eb0de6dadca
tree870cce99a603baa5a008142c3c3c362df2905c7e
parent959a00dc23de6c0a214488b8378a7e744e192213
gdbserver: Update require_int function to parse offset for pread packet

Currently gdbserver uses the require_int() function to parse the
requested offset (in vFile::pread packet and the like).  This function
allows integers up to 0x7fffffff (to fit in 32-bit int), however the
offset (for the pread system call) has an off_t type which can be
larger than 32-bit.

This patch allows require_int() function to parse offset up to the
maximum value implied by the off_t type.

Approved-By: Pedro Alves <pedro@palves.net>
Change-Id: I3691bcc1ab1838c0db7f8b82d297d276a5419c8c
gdb/testsuite/gdb.server/pread-offset-size.S [new file with mode: 0644]
gdb/testsuite/gdb.server/pread-offset-size.exp [new file with mode: 0644]
gdbserver/hostio.cc