This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] Fix broken watchpoints (Re: [patch-ppc] Hardware watchpoint support for 44x/BookE-based systems)
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 12 Aug 2008 15:29:29 -0300
- Subject: Re: [commit] Fix broken watchpoints (Re: [patch-ppc] Hardware watchpoint support for 44x/BookE-based systems)
- References: <200808121823.m7CINwv1010170@d12av02.megacenter.de.ibm.com>
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
Stupid typo.
Thanks for fixing this.
Luis
On Tue, 2008-08-12 at 20:23 +0200, Ulrich Weigand wrote:
> 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 (¤t_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 (¤t_target, AT_PLATFORM, &field))
> + if (target_auxv_search (¤t_target, AT_HWCAP, &field))
> return (unsigned long) field;
>
> return 0;
>