This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix trace file fails on powerpc64
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: yao at codesourcery dot com (Yao Qi)
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 27 Oct 2014 12:07:59 +0100 (CET)
- Subject: Re: [PATCH] Fix trace file fails on powerpc64
- Authentication-results: sourceware.org; auth=none
Yao Qi wrote:
> These fails are caused by writing function descriptor address into trace
> file instead of function address. This patch is to teach tfile.c to
> write function address on powerpc64 target. With this patch applied,
> fails in tfile.exp and mi-traceframe-changed.exp are fixed. Is it
> OK?
>
> gdb/testsuite:
>
> 2014-10-27 Yao Qi <yao@codesourcery.com>
>
> * gdb.trace/tfile.c (adjust_function_address) [__powerpc64__]:
> Get function address from function descriptor.
> ---
> gdb/testsuite/gdb.trace/tfile.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.trace/tfile.c b/gdb/testsuite/gdb.trace/tfile.c
> index e69240a..e9c347c 100644
> --- a/gdb/testsuite/gdb.trace/tfile.c
> +++ b/gdb/testsuite/gdb.trace/tfile.c
> @@ -130,6 +130,9 @@ adjust_function_address (uintptr_t func_addr)
> /* Although Thumb functions are two-byte aligned, function
> pointers have the Thumb bit set. Clear it. */
> return func_addr & ~1;
> +#elif defined __powerpc64__
> + /* Get function address from function descriptor. */
> + return *(uintptr_t *) func_addr;
This will break powerpc64le, which uses the ELFv2 ABI without function
descriptors. The correct test should be something like
#elif defined __powerpc64__ && _CALL_ELF != 2
OK with that change.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com