This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] gdb.trace/entry-values.exp: Fixes for powerpc64.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=98fa59e9b06fa479cafb852ef87e5a9bfd87ae54

commit 98fa59e9b06fa479cafb852ef87e5a9bfd87ae54
Author: Marcin KoÅ?cielnicki <koriakin@0x04.net>
Date:   Sun Mar 6 17:20:08 2016 +0100

    gdb.trace/entry-values.exp: Fixes for powerpc64.
    
    On powerpc64, "disassemble foo" doesn't work properly on object files
    (it can't process the relocations in .opd section) - instead, let's
    link it into an executable and load that.
    
    Also, backtrace displays .main, not main.  Accept both.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
    	use it for disassembly; accept .main in addition to main in backtrace.

Diff:
---
 gdb/testsuite/ChangeLog                  |  5 +++++
 gdb/testsuite/gdb.trace/entry-values.exp | 13 +++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index c044355..6704253 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-09  Marcin KoÅ?cielnicki  <koriakin@0x04.net>
+
+	* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
+	use it for disassembly; accept .main in addition to main in backtrace.
+
 2016-03-09  Wei-cheng Wang  <cole945@gmail.com>
 	    Marcin KoÅ?cielnicki  <koriakin@0x04.net>
 
diff --git a/gdb/testsuite/gdb.trace/entry-values.exp b/gdb/testsuite/gdb.trace/entry-values.exp
index 81b0263..e8ed517 100644
--- a/gdb/testsuite/gdb.trace/entry-values.exp
+++ b/gdb/testsuite/gdb.trace/entry-values.exp
@@ -26,14 +26,19 @@ if  {[gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \
     return -1
 }
 
-# Start GDB and load object file, compute the offset of the
+if  {[gdb_compile [list ${binfile}1.o] \
+	  "${binfile}1" executable {}] != ""} {
+    return -1
+}
+
+# Start GDB and load executable file, compute the offset of the
 # instruction in bar returned from foo.  It is needed in the Dwarf
 # Assembler.
 
 gdb_exit
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}1.o
+gdb_load ${binfile}1
 
 set returned_from_foo ""
 
@@ -183,7 +188,7 @@ gdb_test_no_output "set print entry-values both"
 gdb_test_sequence "bt" "bt (1)" {
     "\[\r\n\]#0 .* foo \\(i=[-]?[0-9]+, i@entry=2, j=[-]?[0-9]+, j@entry=3\\)"
     "\[\r\n\]#1 .* bar \\(i=<optimized out>, i@entry=<optimized out>\\)"
-    "\[\r\n\]#2 .* main \\(\\)"
+    "\[\r\n\]#2 .* \.?main \\(\\)"
 }
 
 # Update global variables 'global1' and 'global2' and test that the
@@ -195,7 +200,7 @@ gdb_test_no_output "set var global2=11"
 gdb_test_sequence "bt" "bt (2)" {
     "\[\r\n\]#0 .* foo \\(i=[-]?[0-9]+, i@entry=10, j=[-]?[0-9]+, j@entry=11\\)"
     "\[\r\n\]#1 .* bar \\(i=<optimized out>, i@entry=<optimized out>\\)"
-    "\[\r\n\]#2 .* main \\(\\)"
+    "\[\r\n\]#2 .* \.?main \\(\\)"
 }
 
 # Restart GDB and trace.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]