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 broken watchpoints (Re: [patch-ppc] Hardware watchpoint support for 44x/BookE-based systems)


Luis Machado wrote:

> 	* ppc-linux-nat.c: Include "auxv.h" and "elf/common.h".
> 	Define PPC_FEATURE_BOOKE.	
> 	(ppc_linux_get_hwcap): New function.
> 	(ppc_linux_region_ok_for_hw_watchpoint): Handle PowerPC 440
> 	4-bytes alignment restrictions.
> 	(ppc_linux_insert_watchpoint): Handle PowerPC 440-specific
> 	positioning of the read/write flags.
> 	(ppc_linux_watchpoint_addr_within_range): Handle PowerPC 440
> 	4-bytes alignment.

unfortunately this patch completely broke watchpoint support for me on Cell.
The reason is that this routine:

>+/* Fetch the AT_HWCAP entry from the aux vector.  */
>+unsigned long ppc_linux_get_hwcap (void)
>+{
>+  CORE_ADDR field;
>+
>+  if (target_auxv_search (&current_target, AT_PLATFORM, &field))
>+    return (unsigned long) field;

really needs to fetch AT_HWCAP, *not* AT_PLATFORM (which is a string).

Fixed by the patch below.  Tested on powerpc-linux and powerpc64-linux
(on Cell/B.E.), checked into mainline.

Bye,
Ulrich


ChangeLog:

	* ppc-linux-nat.c (ppc_linux_get_hwcap): Really get AT_HWCAP.


diff -urNp gdb-orig/gdb/ppc-linux-nat.c gdb-head/gdb/ppc-linux-nat.c
--- gdb-orig/gdb/ppc-linux-nat.c	2008-08-12 19:13:15.793562000 +0200
+++ gdb-head/gdb/ppc-linux-nat.c	2008-08-12 19:49:17.363981345 +0200
@@ -835,7 +835,7 @@ unsigned long ppc_linux_get_hwcap (void)
 {
   CORE_ADDR field;
 
-  if (target_auxv_search (&current_target, AT_PLATFORM, &field))
+  if (target_auxv_search (&current_target, AT_HWCAP, &field))
     return (unsigned long) field;
 
   return 0;

-- 
  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]