Fix build breakage on GNU/Linux AArch64
authorSergio Durigan Junior <sergiodj@redhat.com>
Sun, 10 Sep 2017 16:16:54 +0000 (12:16 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Sun, 10 Sep 2017 16:33:28 +0000 (12:33 -0400)
This patch fixes the build breakage that has been happening on AArch64
since September 5th.  The breakage was introduced by the following
commit:

  author        Yao Qi <yao.qi@linaro.org>
          Tue, 5 Sep 2017 04:54:52 -0400 (09:54 +0100)
  committer     Yao Qi <yao.qi@linaro.org>
          Tue, 5 Sep 2017 04:54:52 -0400 (09:54 +0100)
  commit        f7000548a2b79d7e5cb924468117ca4245e6b820

  Use VEC for target_desc.reg_defs

The build log for this commit can be seen here:

  <https://gdb-build.sergiodj.net/builders/Ubuntu-AArch64-native-gdbserver-m64/builds/2696/steps/compile%20gdb/logs/stdio>

And the underlying problem is that the code is not calling the new
function "allocate_target_description" to allocate the "struct
target_desc" using "new" instead of XNEW, which end up not properly
initializing the fields of the structure.

Regtested on BuildBot.

gdb/gdbserver/ChangeLog:
2017-09-10  Sergio Durigan Junior  <sergiodj@redhat.com>

* linux-low.c (handle_extended_wait): Use
"allocate_target_description" instead of "XNEW".
* linux-x86-low.c (initialize_low_arch): Likewise.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-x86-low.c

index ac73db2b89c276add0bc04e1e52b68bd2ddd3d6b..345abb3e7314db0215379eaf0058417b62acc704 100644 (file)
@@ -1,3 +1,9 @@
+2017-09-10  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * linux-low.c (handle_extended_wait): Use
+       "allocate_target_description" instead of "XNEW".
+       * linux-x86-low.c (initialize_low_arch): Likewise.
+
 2017-09-05  Yao Qi  <yao.qi@linaro.org>
 
        * configure.srv (srv_i386_regobj): Remove.
index 6f4b26afb9486c7a94e4bcc543a933b7f32a7ace..a7859cce88998a1ee305df032b1349067868928e 100644 (file)
@@ -570,7 +570,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
 
          clone_all_breakpoints (child_thr, event_thr);
 
-         tdesc = XNEW (struct target_desc);
+         tdesc = allocate_target_description ();
          copy_target_description (tdesc, parent_proc->tdesc);
          child_proc->tdesc = tdesc;
 
index f09871ac36fc9fad0451056daa36b547dbe32743..844a1656660a977a6e56a087c319dbc72ba7d355 100644 (file)
@@ -2900,7 +2900,7 @@ initialize_low_arch (void)
 {
   /* Initialize the Linux target descriptions.  */
 #ifdef __x86_64__
-  tdesc_amd64_linux_no_xml = XNEW (struct target_desc);
+  tdesc_amd64_linux_no_xml = allocate_target_description ();
   copy_target_description (tdesc_amd64_linux_no_xml,
                           amd64_linux_read_description (X86_XSTATE_SSE_MASK,
                                                         false));
@@ -2911,7 +2911,7 @@ initialize_low_arch (void)
   initialize_low_tdesc ();
 #endif
 
-  tdesc_i386_linux_no_xml = XNEW (struct target_desc);
+  tdesc_i386_linux_no_xml = allocate_target_description ();
   copy_target_description (tdesc_i386_linux_no_xml,
                           i386_linux_read_description (X86_XSTATE_SSE_MASK));
   tdesc_i386_linux_no_xml->xmltarget = xmltarget_i386_linux_no_xml;
This page took 0.036919 seconds and 4 git commands to generate.