Fix regression from multi-arch patch.
authorPedro Alves <palves@redhat.com>
Tue, 11 Jun 2013 17:26:25 +0000 (17:26 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 11 Jun 2013 17:26:25 +0000 (17:26 +0000)
This fixes the regression reported at
<http://sourceware.org/ml/gdb-patches/2013-06/msg00185.html>.

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  <palves@redhat.com>

* linux-low.c (initialize_regsets_info): Use xcalloc instead of
xmalloc.

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

index c73cccfd7354ef3f19fd2db77067a83469b044a5..169bb532658bd2c8b71a59cad5be21cd0dd975ff 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-11  Pedro Alves  <palves@redhat.com>
+
+       * linux-low.c (initialize_regsets_info): Use xcalloc instead of
+       xmalloc.
+
 2013-06-11  Pedro Alves  <palves@redhat.com>
 
        * linux-x86-low.c (initialize_low_arch): Call
index f7e510edbd4041f803be445e9c009d466027f108..2114b07f5e5a8d8b8a6cb4f7dcbebe93528d5a92 100644 (file)
@@ -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