This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Fix another ppc-autodetect gdbserver bug


Hello,

it seems I have missed one fix when checking in autodetection support for 
the ppc/ppc64 gdbserver.  In ppc_arch_setup, after installing the initial
register set, we need to reset ppc_hwcap to reflect that register set
(i.e. no AltiVec, no SPE).

This doesn't matter on the first call to ppc_arch_setup as ppc_hwcap is 0
anyway.  However, on subsequent calls, if we do not reset ppc_hwcap, the
first collect_register_by_name call will fail in ppc_fill_vrregset (because
it attempts to access registers not present in the vanilla register set).

I had this change in my patch for a while, but I must have applied the
wrong version.  Sorry for the mix-up.

Tested on powerpc64-linux; fixed the ext-attach regression.

Applied to mainline.

Bye,
Ulrich


ChangeLog:

	* linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
	initial call to init_register_ppc64.

diff -urNp gdb-orig/gdb/gdbserver/linux-ppc-low.c gdb-head/gdb/gdbserver/linux-ppc-low.c
--- gdb-orig/gdb/gdbserver/linux-ppc-low.c	2008-04-21 15:19:41.500935000 +0200
+++ gdb-head/gdb/gdbserver/linux-ppc-low.c	2008-04-21 20:55:03.975798070 +0200
@@ -223,8 +223,11 @@ ppc_arch_setup (void)
 #ifdef __powerpc64__
   long msr;
 
-  /* On a 64-bit host, assume 64-bit inferior process.  */
+  /* On a 64-bit host, assume 64-bit inferior process with no
+     AltiVec registers.  Reset ppc_hwcap to ensure that the
+     collect_register call below does not fail.  */
   init_registers_ppc64 ();
+  ppc_hwcap = 0;
 
   /* Only if the high bit of the MSR is set, we actually have
      a 64-bit inferior.  */
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]