luser / rust-gdb-remote-protocol

A Rust crate implementing the GDB Remote Serial Protocol
Apache License 2.0
33 stars 13 forks source link

support qOffsets #11

Closed froydnj closed 6 years ago

froydnj commented 6 years ago

It's not super clear that we need this... @tromey, do you know if this is really necessary? (The TODO list in lib.rs is also unclear on this point.)

tromey commented 6 years ago

gdb sends it during the initial connection, but I believe it is fine to simply say it is not supported.

luser commented 6 years ago

I surveyed all the stuff that gdb sent in a simple gdbserver session (pcap file is on the wiki) and tried to filter out things that seemed obviously unnecessary, but I clearly wasn't sure about everything. The docs don't explicitly say it's OK to return an empty response, so it's hard to say. I guess if we support qXfer:libraries:read we can just provide the library load addresses there and this isn't necessary?

tromey commented 6 years ago

That seems to be a bug in the docs. gdbserver does this:

w $qOffsets#4b
r $#00

(That's the remote logging format, "w" means "gdb wrote it" and "r" means "reply from gdbserver.)

It'd be good to collect the various doc bugs and report them to gdb as well.

tromey commented 6 years ago

I guess if we support qXfer:libraries:read we can just provide the library load addresses there and this isn't necessary?

I think so, see https://sourceware.org/bugzilla/show_bug.cgi?id=15696 and the threads it links to.

tromey commented 6 years ago

Filed https://sourceware.org/bugzilla/show_bug.cgi?id=22633 for the doc bug.

tromey commented 6 years ago

Aha, the overview says that any command can have an empty response. https://sourceware.org/gdb/onlinedocs/gdb/Overview.html#Overview

tromey commented 6 years ago

I think we should not bother with qOffsets. gdbserver only implements it for one very obscure case.