Blame SOURCES/gdb-rhbz1225569-oom-killer-aarch64-frame-same-id-8of8.patch

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