[Ada] Better handling of dynamic types in ada_value_primitive_packed_val
[deliverable/binutils-gdb.git] / gdb / aix-thread.c
index 1eb885bed87504b9741650d669afb3e4f9566679..8491dee0917c0d546927ef0371fb68c27e2e151b 100644 (file)
@@ -1,6 +1,6 @@
 /* Low level interface for debugging AIX 4.3+ pthreads.
 
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2015 Free Software Foundation, Inc.
    Written by Nick Duffek <nsd@redhat.com>.
 
    This file is part of GDB.
@@ -46,7 +46,6 @@
 #include "regcache.h"
 #include "gdbcmd.h"
 #include "ppc-tdep.h"
-#include <string.h>
 #include "observer.h"
 #include "objfiles.h"
 
@@ -704,7 +703,7 @@ sync_threadlists (void)
 
   pcount = 0;
   psize = 1;
-  pbuf = (struct pd_thread *) xmalloc (psize * sizeof *pbuf);
+  pbuf = XNEWVEC (struct pd_thread, psize);
 
   for (cmd = PTHDB_LIST_FIRST;; cmd = PTHDB_LIST_NEXT)
     {
@@ -741,7 +740,7 @@ sync_threadlists (void)
 
   gcount = 0;
   iterate_over_threads (giter_count, &gcount);
-  g = gbuf = (struct thread_info **) xmalloc (gcount * sizeof *gbuf);
+  g = gbuf = XNEWVEC (struct thread_info *, gcount);
   iterate_over_threads (giter_accum, &g);
   qsort (gbuf, gcount, sizeof *gbuf, gcmp);
 
@@ -758,9 +757,9 @@ sync_threadlists (void)
       else if (gi == gcount)
        {
          thread = add_thread (ptid_build (infpid, 0, pbuf[pi].pthid));
-         thread->private = xmalloc (sizeof (struct private_thread_info));
-         thread->private->pdtid = pbuf[pi].pdtid;
-         thread->private->tid = pbuf[pi].tid;
+         thread->priv = XNEW (struct private_thread_info);
+         thread->priv->pdtid = pbuf[pi].pdtid;
+         thread->priv->tid = pbuf[pi].tid;
          pi++;
        }
       else
@@ -777,8 +776,8 @@ sync_threadlists (void)
 
          if (cmp_result == 0)
            {
-             gbuf[gi]->private->pdtid = pdtid;
-             gbuf[gi]->private->tid = tid;
+             gbuf[gi]->priv->pdtid = pdtid;
+             gbuf[gi]->priv->tid = tid;
              pi++;
              gi++;
            }
@@ -790,9 +789,9 @@ sync_threadlists (void)
          else
            {
              thread = add_thread (pptid);
-             thread->private = xmalloc (sizeof (struct private_thread_info));
-             thread->private->pdtid = pdtid;
-             thread->private->tid = tid;
+             thread->priv = XNEW (struct private_thread_info);
+             thread->priv->pdtid = pdtid;
+             thread->priv->tid = tid;
              pi++;
            }
        }
@@ -810,7 +809,7 @@ iter_tid (struct thread_info *thread, void *tidp)
 {
   const pthdb_tid_t tid = *(pthdb_tid_t *)tidp;
 
-  return (thread->private->tid == tid);
+  return (thread->priv->tid == tid);
 }
 
 /* Synchronize libpthdebug's state with the inferior and with GDB,
@@ -1000,7 +999,7 @@ aix_thread_resume (struct target_ops *ops,
        error (_("aix-thread resume: unknown pthread %ld"),
               ptid_get_lwp (ptid));
 
-      tid[0] = thread->private->tid;
+      tid[0] = thread->priv->tid;
       if (tid[0] == PTHDB_INVALID_TID)
        error (_("aix-thread resume: no tid for pthread %ld"),
               ptid_get_lwp (ptid));
@@ -1043,7 +1042,7 @@ aix_thread_wait (struct target_ops *ops,
       struct gdbarch *gdbarch = get_regcache_arch (regcache);
 
       if (regcache_read_pc (regcache)
-         - target_decr_pc_after_break (gdbarch) == pd_brk_addr)
+         - gdbarch_decr_pc_after_break (gdbarch) == pd_brk_addr)
        return pd_activate (0);
     }
 
@@ -1314,10 +1313,10 @@ aix_thread_fetch_registers (struct target_ops *ops,
   else
     {
       thread = find_thread_ptid (inferior_ptid);
-      tid = thread->private->tid;
+      tid = thread->priv->tid;
 
       if (tid == PTHDB_INVALID_TID)
-       fetch_regs_user_thread (regcache, thread->private->pdtid);
+       fetch_regs_user_thread (regcache, thread->priv->pdtid);
       else
        fetch_regs_kernel_thread (regcache, regno, tid);
     }
@@ -1668,10 +1667,10 @@ aix_thread_store_registers (struct target_ops *ops,
   else
     {
       thread = find_thread_ptid (inferior_ptid);
-      tid = thread->private->tid;
+      tid = thread->priv->tid;
 
       if (tid == PTHDB_INVALID_TID)
-       store_regs_user_thread (regcache, thread->private->pdtid);
+       store_regs_user_thread (regcache, thread->priv->pdtid);
       else
        store_regs_kernel_thread (regcache, regno, tid);
     }
@@ -1765,8 +1764,8 @@ aix_thread_extra_thread_info (struct target_ops *self,
 
   buf = mem_fileopen ();
 
-  pdtid = thread->private->pdtid;
-  tid = thread->private->tid;
+  pdtid = thread->priv->pdtid;
+  tid = thread->priv->tid;
 
   if (tid != PTHDB_INVALID_TID)
     /* i18n: Like "thread-identifier %d, [state] running, suspended" */
This page took 0.02621 seconds and 4 git commands to generate.