From: Pedro Alves Date: Tue, 11 Jun 2013 17:26:25 +0000 (+0000) Subject: Fix regression from multi-arch patch. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5da6eb0a109d09cf64a82417e92bdf2f80bbda0e;p=binutils-gdb.git Fix regression from multi-arch patch. This fixes the regression reported at . GDBserver was reaching: static int regsets_fetch_inferior_registers (struct regsets_info *regsets_info, struct regcache *regcache) { struct regset_info *regset; int saw_general_regs = 0; int pid; struct iovec iov; regset = regsets_info->regsets; pid = lwpid_of (get_thread_lwp (current_inferior)); while (regset->size >= 0) { void *buf, *data; int nt_type, res; if (regset->size == 0 || regsets_info->disabled_regsets[regset - regsets_info->regsets]) { >>>>>>> regset ++; <<<<<<< HERE continue; } Because info->disabled_regsets[] was not being initialized, and that causes all sorts of wrong. gdb/gdbserver/ 2013-06-11 Pedro Alves * linux-low.c (initialize_regsets_info): Use xcalloc instead of xmalloc. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index c73cccfd735..169bb532658 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2013-06-11 Pedro Alves + + * linux-low.c (initialize_regsets_info): Use xcalloc instead of + xmalloc. + 2013-06-11 Pedro Alves * linux-x86-low.c (initialize_low_arch): Call diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index f7e510edbd4..2114b07f5e5 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -6072,7 +6072,7 @@ initialize_regsets_info (struct regsets_info *info) info->regsets[info->num_regsets].size >= 0; info->num_regsets++) ; - info->disabled_regsets = xmalloc (info->num_regsets); + info->disabled_regsets = xcalloc (1, info->num_regsets); } #endif