[binutils-gdb] AArch64: Ensure lwp info is created zeroed

Alan Hayward alahay01@sourceware.org
Wed Jan 23 11:52:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6594e122864119d7b1434599c22b112f98e178ca

commit 6594e122864119d7b1434599c22b112f98e178ca
Author: Alan Hayward <alan.hayward@arm.com>
Date:   Wed Jan 23 11:31:40 2019 +0000

    AArch64: Ensure lwp info is created zeroed
    
    The code to not set empty hardware BPs/WPs on new threads will only work
    if the newly allocated struct is empty.
    
    Ensure the structure is created zeroed.
    
    This patch removes the remaining racy behaviour on gdb.threads tests
    when run on AArch64 Ubuntu.
    
    gdb/ChangeLog:
    
    	* nat/aarch64-linux.c (aarch64_linux_new_thread): Replace XNEW
    	with XCNEW.

Diff:
---
 gdb/ChangeLog           | 5 +++++
 gdb/nat/aarch64-linux.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 36a97bd..f342acd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-23  Alan Hayward  <alan.hayward@arm.com>
+
+	* nat/aarch64-linux.c (aarch64_linux_new_thread): Replace XNEW
+	with XCNEW.
+
 2019-01-22  Tom Tromey  <tom@tromey.com>
 
 	* corelow.c: Do not include sys/file.h.
diff --git a/gdb/nat/aarch64-linux.c b/gdb/nat/aarch64-linux.c
index 2616c8a..f9a95bb 100644
--- a/gdb/nat/aarch64-linux.c
+++ b/gdb/nat/aarch64-linux.c
@@ -76,7 +76,7 @@ aarch64_linux_new_thread (struct lwp_info *lwp)
   ptid_t ptid = ptid_of_lwp (lwp);
   struct aarch64_debug_reg_state *state
     = aarch64_get_debug_reg_state (ptid.pid ());
-  struct arch_lwp_info *info = XNEW (struct arch_lwp_info);
+  struct arch_lwp_info *info = XCNEW (struct arch_lwp_info);
 
   /* If there are hardware breakpoints/watchpoints in the process then mark that
      all the hardware breakpoint/watchpoint register pairs for this thread need



More information about the Gdb-cvs mailing list