aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/i386-linux-nat.c')
-rw-r--r--gdb/i386-linux-nat.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index bfe3fb8..f5112d2 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -1,6 +1,6 @@
/* Native-dependent code for GNU/Linux i386.
- Copyright (C) 1999-2024 Free Software Foundation, Inc.
+ Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -137,7 +137,7 @@ store_register (const struct regcache *regcache, int regno)
}
-/* Transfering the general-purpose registers between GDB, inferiors
+/* Transferring the general-purpose registers between GDB, inferiors
and core files. */
/* Fill GDB's register array with the general-purpose register values
@@ -234,7 +234,7 @@ static void store_regs (const struct regcache *regcache, int tid, int regno) {}
#endif
-/* Transfering floating-point registers between GDB, inferiors and cores. */
+/* Transferring floating-point registers between GDB, inferiors and cores. */
/* Fill GDB's register array with the floating-point register values in
*FPREGSETP. */
@@ -259,7 +259,7 @@ fill_fpregset (const struct regcache *regcache,
#ifdef HAVE_PTRACE_GETREGS
/* Fetch all floating-point registers from process/thread TID and store
- thier values in GDB's register array. */
+ their values in GDB's register array. */
static void
fetch_fpregs (struct regcache *regcache, int tid)
@@ -304,7 +304,7 @@ store_fpregs (const struct regcache *regcache, int tid, int regno)
#endif
-/* Transfering floating-point and SSE registers to and from GDB. */
+/* Transferring floating-point and SSE registers to and from GDB. */
/* Fetch all registers covered by the PTRACE_GETREGSET request from
process/thread TID and store their values in GDB's register array.
@@ -315,19 +315,19 @@ fetch_xstateregs (struct regcache *regcache, int tid)
{
struct gdbarch *gdbarch = regcache->arch ();
const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
- char xstateregs[tdep->xsave_layout.sizeof_xsave];
+ gdb::byte_vector xstateregs (tdep->xsave_layout.sizeof_xsave);
struct iovec iov;
if (have_ptrace_getregset != TRIBOOL_TRUE)
return 0;
- iov.iov_base = xstateregs;
- iov.iov_len = sizeof(xstateregs);
+ iov.iov_base = xstateregs.data ();
+ iov.iov_len = xstateregs.size ();
if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE,
&iov) < 0)
perror_with_name (_("Couldn't read extended state status"));
- i387_supply_xsave (regcache, -1, xstateregs);
+ i387_supply_xsave (regcache, -1, xstateregs.data ());
return 1;
}
@@ -340,19 +340,19 @@ store_xstateregs (const struct regcache *regcache, int tid, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
- char xstateregs[tdep->xsave_layout.sizeof_xsave];
+ gdb::byte_vector xstateregs (tdep->xsave_layout.sizeof_xsave);
struct iovec iov;
if (have_ptrace_getregset != TRIBOOL_TRUE)
return 0;
-
- iov.iov_base = xstateregs;
- iov.iov_len = sizeof(xstateregs);
+
+ iov.iov_base = xstateregs.data ();
+ iov.iov_len = xstateregs.size ();
if (ptrace (PTRACE_GETREGSET, tid, (unsigned int) NT_X86_XSTATE,
&iov) < 0)
perror_with_name (_("Couldn't read extended state status"));
- i387_collect_xsave (regcache, regno, xstateregs, 0);
+ i387_collect_xsave (regcache, regno, xstateregs.data (), 0);
if (ptrace (PTRACE_SETREGSET, tid, (unsigned int) NT_X86_XSTATE,
(int) &iov) < 0)
@@ -696,9 +696,7 @@ i386_linux_nat_target::low_resume (ptid_t ptid, int step, enum gdb_signal signal
perror_with_name (("ptrace"));
}
-void _initialize_i386_linux_nat ();
-void
-_initialize_i386_linux_nat ()
+INIT_GDB_FILE (i386_linux_nat)
{
linux_target = &the_i386_linux_nat_target;