[PATCH v3 3/3] gdb, gdbserver: introduce the 'x' RSP packet for binary memory read

Tom Tromey tom@tromey.com
Wed Dec 18 18:46:21 GMT 2024


>>>>> "Tankut" == Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> writes:

Tankut> Introduce an RSP packet, 'x', for reading from the remote server
Tankut> memory in binary format.  The binary write packet, 'X' already exists.
Tankut> The 'x' packet is essentially the same as 'm', except that the
Tankut> returned data is in binary format.  For transferring relatively large
Tankut> data from the memory of the remote process, the 'x' packet can reduce the
Tankut> transfer costs.

I don't think this was re-reviewed?  Sorry about the delay on this.

Tankut> +      else if (cs.own_buf[0] == 'x')
Tankut> +	{
Tankut> +	  decode_x_packet (&cs.own_buf[1], &mem_addr, &mem_len);
Tankut> +	  mem_buf = (unsigned char *) xmalloc (mem_len);
Tankut> +	  if (read_inferior_memory (mem_addr, mem_buf, mem_len) == 0)
Tankut> +	    {

[...]

It's sort of weird that this code is copied in 3 places.
However, that's not a problem you invented, maybe we can file a bug
and/or clean this up later.

Tom


More information about the Gdb-patches mailing list