+/* Return a target description for the current target. */
+
+const struct target_desc *
+riscv_linux_nat_target::read_description ()
+{
+ struct riscv_gdbarch_features features;
+ struct iovec iov;
+ elf_fpregset_t regs;
+ int tid;
+
+ /* Figuring out xlen is easy. */
+ features.xlen = sizeof (elf_greg_t);
+
+ tid = inferior_ptid.lwp ();
+
+ iov.iov_base = ®s;
+ iov.iov_len = sizeof (regs);
+
+ /* Can we fetch the f-registers? */
+ if (ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET,
+ (PTRACE_TYPE_ARG3) &iov) == -1)
+ features.flen = 0; /* No f-registers. */
+ else
+ {
+ /* TODO: We need a way to figure out the actual length of the
+ f-registers. We could have 64-bit x-registers, with 32-bit
+ f-registers. For now, just assumed xlen and flen match. */
+ features.flen = features.xlen;
+ }
+
+ return riscv_create_target_description (features);
+}
+