*-fbsd-nat: Handle null inferior in read_description.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 14 Jul 2023 15:39:24 +0000 (08:39 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 14 Jul 2023 15:39:24 +0000 (08:39 -0700)
commit97b6e0f6c88d02eac1df0254cdd5c80f40f4869d
treedfd8f70af406cbf2ea9c5aeeb370bc56ccb88540
parent36b6b4594e729c4a4502dc93c8c3c894287147a6
*-fbsd-nat: Handle null inferior in read_description.

Don't invoke ptrace in the target read_description method if there is
not an active inferior to query via ptrace.  Instead, use the default
register set for the architecture.

Previously the native target could report an error from a failed
ptrace operation when fetching a tdesc without an attached process.
For example on FreeBSD/amd64:

(gdb) target native
Done.  Use the "run" command to start a process.
(gdb) unset tdesc filename
Couldn't get registers: Operation not permitted.
gdb/aarch64-fbsd-nat.c
gdb/amd64-fbsd-nat.c
gdb/arm-fbsd-nat.c
gdb/i386-fbsd-nat.c