diff options
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r-- | gdb/aarch64-linux-nat.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 2e6541f..0fa5bee 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -496,12 +496,11 @@ fetch_tlsregs_from_thread (struct regcache *regcache) gdb_assert (regno != -1); gdb_assert (tdep->tls_register_count > 0); - uint64_t tpidrs[tdep->tls_register_count]; - memset(tpidrs, 0, sizeof(tpidrs)); + std::vector<uint64_t> tpidrs (tdep->tls_register_count); struct iovec iovec; - iovec.iov_base = tpidrs; - iovec.iov_len = sizeof (tpidrs); + iovec.iov_base = tpidrs.data (); + iovec.iov_len = tpidrs.size () * sizeof (tpidrs[0]); int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_TLS, &iovec) != 0) @@ -524,8 +523,7 @@ store_tlsregs_to_thread (struct regcache *regcache) gdb_assert (regno != -1); gdb_assert (tdep->tls_register_count > 0); - uint64_t tpidrs[tdep->tls_register_count]; - memset(tpidrs, 0, sizeof(tpidrs)); + std::vector<uint64_t> tpidrs (tdep->tls_register_count); for (int i = 0; i < tdep->tls_register_count; i++) { @@ -536,8 +534,8 @@ store_tlsregs_to_thread (struct regcache *regcache) } struct iovec iovec; - iovec.iov_base = &tpidrs; - iovec.iov_len = sizeof (tpidrs); + iovec.iov_base = tpidrs.data (); + iovec.iov_len = tpidrs.size () * sizeof (tpidrs[0]); int tid = get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_TLS, &iovec) != 0) |