|
|
2c2fa1 |
commit 763905a3ad8f98d33bd9319790a8d53904554265
|
|
|
2c2fa1 |
Author: Yao Qi <yao@codesourcery.com>
|
|
|
2c2fa1 |
Date: Mon Oct 27 16:37:38 2014 +0800
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
Fix trace file fails on powerpc64
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
I see the following fails on powerpc64-linux,
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
(gdb) target tfile tfile-basic.tf^M
|
|
|
2c2fa1 |
warning: Uploaded tracepoint 1 has no source location, using raw address^M
|
|
|
2c2fa1 |
Tracepoint 1 at 0x10012358^M
|
|
|
2c2fa1 |
Created tracepoint 1 for target's tracepoint 1 at 0x10012358.^M
|
|
|
2c2fa1 |
(gdb) PASS: gdb.trace/tfile.exp: target tfile tfile-basic.tf
|
|
|
2c2fa1 |
info trace^M
|
|
|
2c2fa1 |
Num Type Disp Enb Address What^M
|
|
|
2c2fa1 |
1 tracepoint keep y 0x0000000010012358 <write_basic_trace_file>^M
|
|
|
2c2fa1 |
installed on target^M
|
|
|
2c2fa1 |
(gdb) FAIL: gdb.trace/tfile.exp: info tracepoints on trace file
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
-target-select tfile tfile-basic.tf^M
|
|
|
2c2fa1 |
=thread-group-started,id="i1",pid="1"^M
|
|
|
2c2fa1 |
=thread-created,id="1",group-id="i1"^M
|
|
|
2c2fa1 |
&"warning: Uploaded tracepoint 1 has no source location, using raw address\n"^M
|
|
|
2c2fa1 |
=breakpoint-created,bkpt={number="1",type="tracepoint",disp="keep",enabled="y",
|
|
|
2c2fa1 |
addr="0x0000000010012358",at="<write_basic_trace_file>",thread-groups=["i1"],
|
|
|
2c2fa1 |
times="0",installed="y",original-location="*0x10012358"}^M
|
|
|
2c2fa1 |
~"Created tracepoint 1 for target's tracepoint 1 at 0x10012358.\n"^M
|
|
|
2c2fa1 |
^connected^M
|
|
|
2c2fa1 |
(gdb) ^M
|
|
|
2c2fa1 |
FAIL: gdb.trace/mi-traceframe-changed.exp: tfile: select trace file
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
These fails are caused by writing function descriptor address into trace
|
|
|
2c2fa1 |
file instead of function address. This patch is to teach tfile.c to
|
|
|
2c2fa1 |
write function address on powerpc64 target. With this patch applied,
|
|
|
2c2fa1 |
fails in tfile.exp and mi-traceframe-changed.exp are fixed. Is it
|
|
|
2c2fa1 |
OK?
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
gdb/testsuite:
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
2014-10-27 Yao Qi <yao@codesourcery.com>
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
* gdb.trace/tfile.c (adjust_function_address)
|
|
|
2c2fa1 |
[__powerpc64__ && _CALL_ELF != 2]: Get function address from
|
|
|
2c2fa1 |
function descriptor.
|
|
|
2c2fa1 |
|
|
|
2c2fa1 |
Index: gdb-7.6.1/gdb/testsuite/gdb.trace/tfile.c
|
|
|
2c2fa1 |
===================================================================
|
|
|
2c2fa1 |
--- gdb-7.6.1.orig/gdb/testsuite/gdb.trace/tfile.c
|
|
|
2c2fa1 |
+++ gdb-7.6.1/gdb/testsuite/gdb.trace/tfile.c
|
|
|
2c2fa1 |
@@ -107,6 +107,9 @@ adjust_function_address (uintptr_t func_
|
|
|
2c2fa1 |
/* Although Thumb functions are two-byte aligned, function
|
|
|
2c2fa1 |
pointers have the Thumb bit set. Clear it. */
|
|
|
2c2fa1 |
return func_addr & ~1;
|
|
|
2c2fa1 |
+#elif defined __powerpc64__ && _CALL_ELF != 2
|
|
|
2c2fa1 |
+ /* Get function address from function descriptor. */
|
|
|
2c2fa1 |
+ return *(uintptr_t *) func_addr;
|
|
|
2c2fa1 |
#else
|
|
|
2c2fa1 |
return func_addr;
|
|
|
2c2fa1 |
#endif
|