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

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