gdb: target remote in detached state...
Hannes Domani
ssbssa@yahoo.de
Wed Dec 29 00:53:46 GMT 2021
Am Mittwoch, 29. Dezember 2021, 00:51:56 MEZ hat Mukesh via Gdb-patches <gdb-patches@sourceware.org> Folgendes geschrieben:
> Hello.
> I am currently writing a gdbserver stub for an embedded environment.
>
> So, when firing up gdb and doing target remote or extended-remote, I
> noticed gdb assumes the remote is connected and has a context etc. I was
> wondering if it was possible to somehow tell gdb that is not the case, and
> force my user to attach to a process on the remote side. Of course I could
> fake all that in the beginning, and tell users to ignore and make them run
> "attach" first thing.. but I wondered if there was some way to do it
> automatically. IOW,
> gdb target remote/extended-remote : just hand shake
> gdb> info threads: send gdb/user list of threads
> gdb> attach n: attach now to thread n
> gdb> regular reason, context, etc...
>
> Kindly cc me as I am not subscribed. Thank you!
"target extended-remote" does not assume that the remote already has a context.
Because if you start gdbserver with the "--multi" argument, you can then
(on gdb side, after "target extended-remote") use "attach", and it will attach
the specified process on the remote side.
For the list of available threads/processes, "info os threads"/
"info os processes" (qXfer:osdata:read) needs to be implemented by gdbserver.
Hannes
More information about the Gdb-patches
mailing list