forked from Imagelibrary/binutils-gdb
*-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.
This commit is contained in:
@@ -310,6 +310,9 @@ amd64_fbsd_nat_target::read_description ()
|
||||
struct reg regs;
|
||||
int is64;
|
||||
|
||||
if (inferior_ptid == null_ptid)
|
||||
return this->beneath ()->read_description ();
|
||||
|
||||
if (ptrace (PT_GETREGS, inferior_ptid.pid (),
|
||||
(PTRACE_TYPE_ARG3) ®s, 0) == -1)
|
||||
perror_with_name (_("Couldn't get registers"));
|
||||
|
||||
Reference in New Issue
Block a user