XuNeo opened a new pull request, #15623:
URL: https://github.com/apache/nuttx/pull/15623

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   GDB has introduced binary memory read mode, which can improve memory read 
speed significantly.
   See https://sourceware.org/pipermail/gdb-patches/2024-March/207238.html
   
   ### The main implementation of binary read
   
   
https://github.com/apache/nuttx/commit/6eea3580c4d61d7362687b4b11d307f377599c8d
   
   GDB use the newly introduced packet ‘x addr,length’ to read binary data.
   The response starts with `b` to make it different than normal memory read 
reply.
   More info can be found here 
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Packets.html#Packets
   
   ### Refactor the handing of binary data
   
https://github.com/apache/nuttx/commit/0e9ca65bf9423b84310e0d71104def15540e0e9a
   
   1.  Checksum should be done regarding data on wire. Thus move checksum 
calculation directly to gdb_send_packet/gdb_recv_packet.
   2. Similar for the RLE encoding, moved it to gdb_send_packet
   
   ### Fix the RLE encoding of special binary data 
   
   
https://github.com/apache/nuttx/commit/9691d72334ac1367cbbe08fffc641aae2673a26d
   
   Read/write special data like 0x2a2a2a2a will trigger this issue.
   The current GDB implementation has this flaw. GDB processes the RLE
   decoding before espaping the data, make it impossible to repeate special
   characters.
   
   The details can be seen in GDB source code remote.c
   `remote_target::read_frame function`.
   
   
   ## Impact
   
   Now using latest GDB to read memory will be around 32% faster.
   
   ## Testing
   
   Tested using qemu, with GDB built from source.
   
   ```
   # build GDB from ubuntu-22.04
   apt install gcc build-essential texinfo bison flex libpython3-dev python3 
libgmp-dev libmpfr-dev libreadline-dev
   
    ../binutils-gdb/configure --enable-targets=all --prefix=/gdb 
--disable-binutils --disable-ld --disable-gold --disable-gas --disable-sim 
--disable-gprof --disable-gprofng --disable-gdbserver --without-guile
   ```
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to