* Avoid duplication of SDB headers in libr/include
SDB is an external project and as such it should live in shlr. However,
for simplicity in dealing with the include flags, the SDB headers were
copied in libr/include as well. This patch just keeps the SDB files
confined in shlr/sdb and make sure various r_* libs use the headers from
there.
* Fix pkgconfig file generation
This feature only works with server implementations that have ReverseStep
and ReverseContinue enabled, such as rr. The official gdbserver doesn't support it.
Most servers/clients should have xml support by now so it should behave
like `dp` in any other debugger. vFile is the only way to get detailed pid info unfortunately.
Since r2 doesn't support set/get to large/vector registers (it will still work
when printing gdb's registers with dr/drt or restoring the registers
with reverse stepping), there's a possible issue that the user will get
lots of prints of "r_reg_[get/set]_value: Bit size 128 not supported"
when running various debug commands that use those functions. This fix
simply moves those registers away from gpr to avoid those prints while
still being able to view/restore the registers.
Writing registers with gdbr worked with single registers because
reg_next_diff started at delta 0 and only had to run the diff once for
the single register that was changed. When running reverse
stepping/continue, multiple registers are changed at once so
r_reg_next_diff would fail every time due to incorrect offset calculation.
The new r_reg_next_diff also support different register sizes to restore
all registers correctly.
The endianity swapping part from reg_write isn't needed since the arena
is the return value of 'g' which is already in the correct target byte
order (see: https://sourceware.org/gdb/onlinedocs/gdb/Packets.html#read-registers-packet)
The socket object was free'd without closing the fd. In the following
gdbr_connect attempts, tcp's connect would freeze on a valid socket since
connection based protocol sockets may successfully connect only once,
any connections beyond that are undefined behavior.
Previously, write_registers sent a partial string instead of the
correct register format which specifies that each byte should be
represented by two hex digits.
The previous gdbr implementation didn't allow interrupting background
tasks with &b since send_vcon wasn't properly configured with the cons
api. In addition to that, gdbserver doesn't support processing multiple
commands at the same time, resulting in undefined behavior once cons
were set up for vcont.
This commit adds the relevant cons api and solves the concurrency issues
by adding locks on all socket related logic.
* Added ba2 so that the gdbserver backend connects correctly
* Fixes to remote gdb register writes:
1. Byte order is target-defined. Use cfg.bigendian for now. Possibly get it from target later?
2. Register number should be hexadecimal.