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]

Re: [obv] [s390] gdbserver regcache compilation fix


On Thursday 21 January 2010 19:28:52, Jan Kratochvil wrote:
> Hi Pedro,
> 
> checked-in this one as [obv] althought remains IMO-non-obv ppc:

Thanks.

> 
> linux-ppc-low.c: In function ‘ppc_arch_setup’:
> linux-ppc-low.c:347: warning: passing argument 1 of ‘collect_register_by_name’ from incompatible pointer type
> linux-ppc-low.c:347: warning: passing argument 2 of ‘collect_register_by_name’ from incompatible pointer type
> linux-ppc-low.c:347: error: too few arguments to function ‘collect_register_by_name’

Hmm, I see, I only built a 32-bit ppc gdbserver, and this is code
guarded on #ifdef __powerpc64__.

The fix becomes obvious considering that before my change,
collect_registers_by_... used to call get_thread_registers itself, the
change mostly just moved this call up to the caller sites.
I've applied this patch below, after confirming a 64-bit
ppc gdbserver now builds.  Let me know if something
still isn't working.

-- 
Pedro Alves

2010-01-21  Pedro Alves  <pedro@codesourcery.com>

	gdb/gdbserver/
	* linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.

---
 gdb/gdbserver/linux-ppc-low.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: src/gdb/gdbserver/linux-ppc-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-ppc-low.c	2010-01-21 13:46:00.000000000 -0800
+++ src/gdb/gdbserver/linux-ppc-low.c	2010-01-21 13:46:09.000000000 -0800
@@ -335,6 +335,7 @@ ppc_arch_setup (void)
 {
 #ifdef __powerpc64__
   long msr;
+  struct regcache *regcache;
 
   /* On a 64-bit host, assume 64-bit inferior process with no
      AltiVec registers.  Reset ppc_hwcap to ensure that the
@@ -344,7 +345,8 @@ ppc_arch_setup (void)
 
   /* Only if the high bit of the MSR is set, we actually have
      a 64-bit inferior.  */
-  collect_register_by_name ("msr", &msr);
+  regcache = get_thread_regcache (current_inferior, 1);
+  collect_register_by_name (regcache, "msr", &msr);
   if (msr < 0)
     {
       ppc_get_hwcap (&ppc_hwcap);


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