Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Aug 2006 17:29:36 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 103350 for review
Message-ID:  <200608061729.k76HTatI001269@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=103350

Change 103350 by marcel@marcel_nfs on 2006/08/06 17:29:29

	Sync with the new world order.

Affected files ...

.. //depot/projects/gdb/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#6 edit

Differences ...

==== //depot/projects/gdb/gnu/usr.bin/gdb/libgdb/fbsd-threads.c#6 (text+ko) ====

@@ -111,22 +111,18 @@
 					 td_event_msg_t *msg);
 static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th,
 				      td_thrinfo_t *infop);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_getxmmregs_p) (const td_thrhandle_t *th,
-					char *regset);
-#endif
+static td_err_e (*td_thr_getxregs_p) (const td_thrhandle_t *th,
+				      void *regs);
 static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th,
-				       prfpregset_t *regset);
+				       struct fpreg *regs);
 static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th,
-				      prgregset_t gregs);
-#ifdef PT_GETXMMREGS
-static td_err_e (*td_thr_setxmmregs_p) (const td_thrhandle_t *th,
-					const char *fpregs);
-#endif
+				      struct reg *regs);
+static td_err_e (*td_thr_setxregs_p) (const td_thrhandle_t *th,
+				      const void *regs);
 static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th,
-				       const prfpregset_t *fpregs);
+				       const struct fpreg *regs);
 static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th,
-				      prgregset_t gregs);
+				      const struct reg *regs);
 static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, int event);
 
 static td_err_e (*td_thr_sstep_p) (td_thrhandle_t *th, int step);
@@ -792,12 +788,10 @@
 static void
 fbsd_lwp_fetch_registers (int regno)
 {
-  gregset_t gregs;
-  fpregset_t fpregs;
+  struct reg gregs;
+  struct fpreg fpregs;
   lwpid_t lwp;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
+  char xregs[512];
 
   if (!target_has_execution)
     {
@@ -812,32 +806,26 @@
     error ("Cannot get lwp %d registers: %s\n", lwp, safe_strerror (errno));
   supply_gregset (&gregs);
   
-#ifdef PT_GETXMMREGS
-  if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == 0)
+  if (ptrace (PT_GETXREGS, lwp, xregs, 0) == 0)
     {
-      i387_supply_fxsave (current_regcache, -1, xmmregs);
+      i387_supply_fxsave (current_regcache, -1, xregs);
     }
   else
     {
-#endif
       if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
 	error ("Cannot get lwp %d registers: %s\n ", lwp, safe_strerror (errno));
       supply_fpregset (&fpregs);
-#ifdef PT_GETXMMREGS
     }
-#endif
 }
 
 static void
 fbsd_thread_fetch_registers (int regno)
 {
-  prgregset_t gregset;
-  prfpregset_t fpregset;
+  struct reg gregs;
+  struct fpreg fpregs;
   td_thrhandle_t th;
   td_err_e err;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
+  char xregs[512];
 
   if (!IS_THREAD (inferior_ptid))
     {
@@ -851,42 +839,36 @@
            pid_to_thread_id (inferior_ptid),           
            GET_THREAD (inferior_ptid), thread_db_err_str (err));
 
-  err = td_thr_getgregs_p (&th, gregset);
+  err = td_thr_getgregs_p (&th, &gregs);
   if (err != TD_OK)
     error ("Cannot fetch general-purpose registers for thread %d: Thread ID=%ld, %s",
            pid_to_thread_id (inferior_ptid),
            GET_THREAD (inferior_ptid), thread_db_err_str (err));
-#ifdef PT_GETXMMREGS
-  err = td_thr_getxmmregs_p (&th, xmmregs);
+  err = td_thr_getxregs_p (&th, xregs);
   if (err == TD_OK)
     {
-      i387_supply_fxsave (current_regcache, -1, xmmregs);
+      i387_supply_fxsave (current_regcache, -1, xregs);
     }
   else
     {
-#endif
-      err = td_thr_getfpregs_p (&th, &fpregset);
+      err = td_thr_getfpregs_p (&th, &fpregs);
       if (err != TD_OK)
 	error ("Cannot get floating-point registers for thread %d: Thread ID=%ld, %s",
 	       pid_to_thread_id (inferior_ptid),
 	       GET_THREAD (inferior_ptid), thread_db_err_str (err));
-      supply_fpregset (&fpregset);
-#ifdef PT_GETXMMREGS
+      supply_fpregset (&fpregs);
     }
-#endif
 
-  supply_gregset (gregset);
+  supply_gregset (&gregs);
 }
 
 static void
 fbsd_lwp_store_registers (int regno)
 {
-  gregset_t gregs;
-  fpregset_t fpregs;
+  struct reg gregs;
+  struct fpreg fpregs;
   lwpid_t lwp;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
+  char xregs[512];
 
   /* FIXME, is it possible ? */
   if (!IS_LWP (inferior_ptid))
@@ -904,19 +886,17 @@
   if (ptrace (PT_SETREGS, lwp, (caddr_t) &gregs, 0) == -1)
       error ("Cannot set lwp %d registers: %s\n", lwp, safe_strerror (errno));
 
-#ifdef PT_GETXMMREGS
   if (regno != -1)
-    if (ptrace (PT_GETXMMREGS, lwp, xmmregs, 0) == -1)
-      goto noxmm;
+    if (ptrace (PT_GETXREGS, lwp, xregs, 0) == -1)
+      goto nox;
 
-  i387_fill_fxsave (xmmregs, regno);
-  if (ptrace (PT_SETXMMREGS, lwp, xmmregs, 0) == -1)
-    goto noxmm;
+  i387_fill_fxsave (xregs, regno);
+  if (ptrace (PT_SETXREGS, lwp, xregs, 0) == -1)
+    goto nox;
 
   return;
 
-noxmm:
-#endif
+nox:
 
   if (regno != -1)
     if (ptrace (PT_GETFPREGS, lwp, (caddr_t) &fpregs, 0) == -1)
@@ -932,13 +912,11 @@
 static void
 fbsd_thread_store_registers (int regno)
 {
-  prgregset_t gregset;
-  prfpregset_t fpregset;
+  struct reg gregs;
+  struct fpreg fpregs;
   td_thrhandle_t th;
   td_err_e err;
-#ifdef PT_GETXMMREGS
-  char xmmregs[512];
-#endif
+  char xregs[512];
 
   if (!IS_THREAD (inferior_ptid))
     {
@@ -958,34 +936,30 @@
       char old_value[MAX_REGISTER_SIZE];
 
       regcache_collect (regno, old_value);
-      err = td_thr_getgregs_p (&th, gregset);
+      err = td_thr_getgregs_p (&th, &gregs);
       if (err != TD_OK)
         error ("%s: td_thr_getgregs %s", __func__, thread_db_err_str (err));
-      err = td_thr_getfpregs_p (&th, &fpregset);
+      err = td_thr_getfpregs_p (&th, &fpregs);
       if (err != TD_OK)
         error ("%s: td_thr_getfpgregs %s", __func__, thread_db_err_str (err));
       supply_register (regno, old_value);
     }
 
-  fill_gregset (gregset, regno);
-  fill_fpregset (&fpregset, regno);
-#ifdef PT_GETXMMREGS
-  i387_fill_fxsave (xmmregs, regno);
-#endif
+  fill_gregset (&gregs, regno);
+  fill_fpregset (&fpregs, regno);
+  i387_fill_fxsave (xregs, regno);
 
-  err = td_thr_setgregs_p (&th, gregset);
+  err = td_thr_setgregs_p (&th, &gregs);
   if (err != TD_OK)
     error ("Cannot store general-purpose registers for thread %d: Thread ID=%d, %s",
            pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
            thread_db_err_str (err));
 
-#ifdef PT_GETXMMREGS
-  err = td_thr_setxmmregs_p (&th, xmmregs);
+  err = td_thr_setxregs_p (&th, xregs);
   if (err == TD_OK)
     return;
-#endif
 
-  err = td_thr_setfpregs_p (&th, &fpregset);
+  err = td_thr_setfpregs_p (&th, &fpregs);
   if (err != TD_OK)
     error ("Cannot store floating-point registers for thread %d: Thread ID=%d, %s",
            pid_to_thread_id (inferior_ptid), GET_THREAD (inferior_ptid),
@@ -1060,7 +1034,7 @@
   td_thrhandle_t th;
   td_thrinfo_t ti;
   td_err_e err;
-  gregset_t gregs;
+  struct reg gregs;
   lwpid_t lwp;
 
   if (IS_THREAD (ptid))
@@ -1460,14 +1434,10 @@
   resolve(td_ta_map_lwp2thr);
   resolve(td_ta_thr_iter);
   resolve(td_thr_get_info);
-#ifdef PT_GETXMMREGS
-  resolve(td_thr_getxmmregs);
-#endif
+  resolve(td_thr_getxregs);
   resolve(td_thr_getfpregs);
   resolve(td_thr_getgregs);
-#ifdef PT_GETXMMREGS
-  resolve(td_thr_setxmmregs);
-#endif
+  resolve(td_thr_setxregs);
   resolve(td_thr_setfpregs);
   resolve(td_thr_setgregs);
   resolve(td_thr_sstep);
@@ -1586,7 +1556,7 @@
 }
 
 ps_err_e
-ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, prgregset_t gregset)
+ps_lgetregs (struct ps_prochandle *ph, lwpid_t lwpid, struct reg *gregs)
 {
   struct cleanup *old_chain;
 
@@ -1596,79 +1566,76 @@
   inferior_ptid = BUILD_LWP (0, lwpid);
 
   target_fetch_registers (-1);
-  fill_gregset (gregset, -1);
+  fill_gregset (gregs, -1);
   do_cleanups (old_chain);
   return PS_OK;
 }
 
 ps_err_e
-ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const prgregset_t gregset)
+ps_lsetregs (struct ps_prochandle *ph, lwpid_t lwpid, const struct reg *gregs)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_ptid ();
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  supply_gregset (gregset);
+  supply_gregset (gregs);
   target_store_registers (-1);
   do_cleanups (old_chain);
   return PS_OK;
 }
 
 ps_err_e
-ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, prfpregset_t *fpregset)
+ps_lgetfpregs (struct ps_prochandle *ph, lwpid_t lwpid, struct fpreg *fpregs)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_ptid ();
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
   target_fetch_registers (-1);
-  fill_fpregset (fpregset, -1);
+  fill_fpregset (fpregs, -1);
   do_cleanups (old_chain);
   return PS_OK;
 }
 
 ps_err_e
 ps_lsetfpregs (struct ps_prochandle *ph, lwpid_t lwpid,
-               const prfpregset_t *fpregset)
+               const struct fpreg *fpregs)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_ptid ();
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  supply_fpregset (fpregset);
+  supply_fpregset (fpregs);
   target_store_registers (-1);
   do_cleanups (old_chain);
   return PS_OK;
 }
 
-#ifdef PT_GETXMMREGS
 ps_err_e
-ps_lgetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid, char *xmmregs)
+ps_lgetxregs (struct ps_prochandle *ph, lwpid_t lwpid, void *xregs)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_ptid ();
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
   target_fetch_registers (-1);
-  i387_fill_fxsave (xmmregs, -1);
+  i387_fill_fxsave (xregs, -1);
   do_cleanups (old_chain);
   return PS_OK;
 }
 
 ps_err_e
-ps_lsetxmmregs (struct ps_prochandle *ph, lwpid_t lwpid,
-		const char *xmmregs)
+ps_lsetxregs (struct ps_prochandle *ph, lwpid_t lwpid, const void *xregs)
 {
   struct cleanup *old_chain;
 
   old_chain = save_inferior_ptid ();
   inferior_ptid = BUILD_LWP (lwpid, PIDGET (inferior_ptid));
-  i387_supply_fxsave (current_regcache, -1, xmmregs);
+  i387_supply_fxsave (current_regcache, -1, xregs);
   target_store_registers (-1);
   do_cleanups (old_chain);
   return PS_OK;
 }
-#endif
 
 ps_err_e
 ps_lstop(struct ps_prochandle *ph, lwpid_t lwpid)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608061729.k76HTatI001269>