gdb 13.2 update OBS-URL: https://build.opensuse.org/request/show/1093460 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=358
51 lines
1.5 KiB
Diff
51 lines
1.5 KiB
Diff
From 0f363ed540fef466f45eab4570c23853e1f14898 Mon Sep 17 00:00:00 2001
|
|
From: Roland McGrath <mcgrathr@google.com>
|
|
Date: Thu, 9 Feb 2023 10:47:17 -0800
|
|
Subject: [PATCH] [aarch64] Avoid initializers for VLAs
|
|
|
|
Clang doesn't accept initializer syntax for variable-length
|
|
arrays in C. Just use memset instead.
|
|
---
|
|
gdb/aarch64-linux-nat.c | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
|
|
index e4158236db2..ecb2eeb9540 100644
|
|
--- a/gdb/aarch64-linux-nat.c
|
|
+++ b/gdb/aarch64-linux-nat.c
|
|
@@ -56,6 +56,8 @@
|
|
|
|
#include "nat/aarch64-mte-linux-ptrace.h"
|
|
|
|
+#include <string.h>
|
|
+
|
|
#ifndef TRAP_HWBKPT
|
|
#define TRAP_HWBKPT 0x0004
|
|
#endif
|
|
@@ -445,7 +447,9 @@ 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] = { 0 };
|
|
+ uint64_t tpidrs[tdep->tls_register_count];
|
|
+ memset(tpidrs, 0, sizeof(tpidrs));
|
|
+
|
|
struct iovec iovec;
|
|
iovec.iov_base = tpidrs;
|
|
iovec.iov_len = sizeof (tpidrs);
|
|
@@ -471,7 +475,8 @@ 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] = { 0 };
|
|
+ uint64_t tpidrs[tdep->tls_register_count];
|
|
+ memset(tpidrs, 0, sizeof(tpidrs));
|
|
|
|
for (int i = 0; i < tdep->tls_register_count; i++)
|
|
{
|
|
|
|
base-commit: a39101060cdf2ee239833106fb3bdf9585f858aa
|
|
--
|
|
2.35.3
|
|
|