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] Relax gdb.compile/compile.exp to match the address printed for frame


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

commit d8447b6b9fd288ebd35620178ba720b1f0ce7ebf
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Jan 17 11:19:03 2018 +0000

    Relax gdb.compile/compile.exp to match the address printed for frame
    
    One test in gdb.compile/compile.exp passes on one fedora builder,
    
     bt
     #0  0x00007ffff7ff43f6 in _gdb_expr (__regs=0x7ffff7ff2000) at gdb
     command line:1^M
     #1  <function called from gdb>^M
     #2  main () at /home/gdb-buildbot/fedora-x86-64-1/fedora-x86-64/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.compile/compile.c:106^M
     (gdb) PASS: gdb.compile/compile.exp: bt
    
    but fails on my machine with gcc trunk,
    
     bt^M
     #0  _gdb_expr (__regs=0x7ffff7ff3000) at gdb command line:1^M
     #1  <function called from gdb>^M
     #2  main () at gdb/testsuite/gdb.compile/compile.c:106^M
     (gdb) FAIL: gdb.compile/compile.exp: bt
    
    The test should be tweaked to match both cases (pc in the start of line
    vs pc in the middle of line).  Note that I am not clear that why libcc1
    emits debug info this way so that the address is in the middle of line.
    
    gdb/testsuite:
    
    2018-01-17  Yao Qi  <yao.qi@linaro.org>
    
    	* gdb.compile/compile.exp: Match the address printed for
    	frame in the output of command "bt".

Diff:
---
 gdb/testsuite/ChangeLog               | 5 +++++
 gdb/testsuite/gdb.compile/compile.exp | 7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 452f6c9..cd99b84 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-17  Yao Qi  <yao.qi@linaro.org>
+
+	* gdb.compile/compile.exp: Match the address printed for
+	frame in the output of command "bt".
+
 2018-01-15  Tom Tromey  <tom@tromey.com>
 
 	* gdb.guile/scm-ports.exp (test_mem_port_rw): Use get_valueof to
diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp
index 15f7cf1..4303c02 100644
--- a/gdb/testsuite/gdb.compile/compile.exp
+++ b/gdb/testsuite/gdb.compile/compile.exp
@@ -139,8 +139,11 @@ gdb_test "compile code func_doesnotexist ();" "warning: Could not find symbol \"
 gdb_test "compile code *(volatile int *) 0 = 0;" \
     "The program being debugged was signaled while in a function called from GDB\\.\r\nGDB remains in the frame where the signal was received\\.\r\n.*" \
     "compile code segfault first"
-gdb_test "bt" \
-    "\r\n#0  \[^\r\n\]* in _gdb_expr \[^\r\n\]*\r\n#1  <function called from gdb>\r\n.*"
+gdb_test "bt" [multi_line \
+		   "#0  ($hex in )?_gdb_expr .*" \
+		   "#1  <function called from gdb>" \
+		   "#2  .*" \
+		  ]
 
 set test "p/x \$pc"
 set infcall_pc 0


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