This is the mail archive of the gdb-patches@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]

[commit/testsuite] Testsuite tweaks for RealView


This batch of testsuite fixups is specific to RealView, and in some
cases specific to bare metal also; you can use RealView on Linux, but
I doubt it compresses the initialization image of .data there.

This compiler generates "short" and "long" instead of GCC's "short
int" and "long int".  I've fixed this up in the testsuite before, but
new instances have appeared.

There are also some differences in section names, et cetera.

Tested on arm-eabi, checked in on HEAD.

-- 
Daniel Jacobowitz
CodeSourcery

2010-03-24  Daniel Jacobowitz  <dan@codesourcery.com>

	* gdb.base/completion.exp: Allow long instead of long int.
	* gdb.base/ending-run.exp: Match _rt_entry.* for RealView.
	* gdb.base/gdbvars.c (main): Remove unused usestubs code.  Reference
	variable p.
	* gdb.base/maint.exp: Allow ER_RO and ER_RW instead of .text and .data.
	* gdb.base/pointers.exp: Allow long instead of long int.
	* gdb.base/printcmds.exp: XFAIL for RealView on ARM EABI.
	* gdb.base/step-line.exp: Allow a directory before the source file name.

---
 gdb/testsuite/gdb.base/completion.exp |    2 +-
 gdb/testsuite/gdb.base/ending-run.exp |    2 +-
 gdb/testsuite/gdb.base/gdbvars.c      |    6 +-----
 gdb/testsuite/gdb.base/maint.exp      |   26 ++++++++++++++++++--------
 gdb/testsuite/gdb.base/pointers.exp   |    2 +-
 gdb/testsuite/gdb.base/printcmds.exp  |    8 ++++++++
 gdb/testsuite/gdb.base/step-line.exp  |    2 +-
 7 files changed, 31 insertions(+), 17 deletions(-)

Index: gdb-mainline/gdb/testsuite/gdb.base/completion.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/completion.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/completion.exp	2010-03-24 13:45:12.000000000 -0700
@@ -796,7 +796,7 @@ gdb_expect  {
                       -re "marker1.*$gdb_prompt info func marker$"\
                       { send_gdb "\n"
                         gdb_expect {
-                                -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
+                                -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long( int)?\\);.*$gdb_prompt $"\
                                                   { pass "complete 'info func marke'"}
                                 -re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
                                 timeout           {fail "(timeout) complete 'info func marke'"}
Index: gdb-mainline/gdb/testsuite/gdb.base/ending-run.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/ending-run.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/ending-run.exp	2010-03-24 13:45:12.000000000 -0700
@@ -173,7 +173,7 @@ gdb_expect {
 	# This is what happens on ARM in thumb mode -fn 2000-02-01
 	pass "step out of main"
     }
-    -re ".*__rt_entry ().*$gdb_prompt $" {
+    -re ".*__rt_entry.* ().*$gdb_prompt $" {
 	# This is what happens on the ARM RVDS runtime
 	pass "step out of main"
     }
Index: gdb-mainline/gdb/testsuite/gdb.base/gdbvars.c
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/gdbvars.c	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/gdbvars.c	2010-03-24 13:45:12.000000000 -0700
@@ -7,10 +7,6 @@ ptr p = &p;
 int
 main ()
 {
-#ifdef usestubs
-    set_debug_traps ();
-    breakpoint ();
-#endif
-
+  p = &p;
   return 0;
 }
Index: gdb-mainline/gdb/testsuite/gdb.base/maint.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/maint.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/maint.exp	2010-03-24 13:45:12.000000000 -0700
@@ -429,9 +429,19 @@ set timeout [expr $timeout + 300]
 #
 # And by the way: This testpoint will break for PA64, where a.out's
 # are ELF files.
-#
+
+# Standard GNU names.
+set text_section ".text"
+set data_section ".data"
+
 send_gdb "maint info sections\n"
 gdb_expect  {
+        -re "Exec file:\r\n.*break($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
+	    # Looks like RealView which uses different section names.
+	    set text_section ER_RO
+	    set data_section ER_RW
+	    pass "maint info sections"
+	}
         -re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $"\
                         { pass "maint info sections" }
         -re ".*$gdb_prompt $"       { fail "maint info sections" }
@@ -440,11 +450,11 @@ gdb_expect  {
 
 # Test for new option: maint info sections <section name>
 # If you don't have a .text section, this will require tweaking.
-send_gdb "maint info sections .text\n"
+send_gdb "maint info sections $text_section\n"
 gdb_expect {
     -re ".* \\.bss .*$gdb_prompt $"      { fail "maint info sections .text" }
-    -re ".* \\.data .*$gdb_prompt $"     { fail "maint info sections .text" }
-    -re ".* \\.text .*$gdb_prompt $"  { pass "maint info sections .text" }
+    -re ".* $data_section .*$gdb_prompt $"     { fail "maint info sections .text" }
+    -re ".* $text_section .*$gdb_prompt $"  { pass "maint info sections .text" }
     -re ".*$gdb_prompt $"           { fail "maint info sections .text" }
     timeout               { fail "(timeout) maint info sections .text" }
 }
@@ -453,8 +463,8 @@ gdb_expect {
 # If your data section is tagged CODE, xfail this test.
 send_gdb "maint info sections CODE\n"
 gdb_expect {
-    -re ".* \\.data .*$gdb_prompt $" { fail "maint info sections CODE" }
-    -re ".* \\.text .*$gdb_prompt $" { pass "maint info sections CODE" }
+    -re ".* $data_section .*$gdb_prompt $" { fail "maint info sections CODE" }
+    -re ".* $text_section .*$gdb_prompt $" { pass "maint info sections CODE" }
     -re ".*$gdb_prompt $"          { fail "maint info sections CODE" }
     timeout              { fail "(timeout) maint info sections CODE" }
 }
@@ -467,8 +477,8 @@ gdb_expect {
 setup_xfail "*-*-*cygwin*"
 send_gdb "maint info sections DATA\n"
 gdb_expect {
-    -re ".* \\.text .*$gdb_prompt $" { fail "maint info sections DATA" }
-    -re ".* \\.data .*$gdb_prompt $" { pass "maint info sections DATA" }
+    -re ".* $text_section .*$gdb_prompt $" { fail "maint info sections DATA" }
+    -re ".* $data_section .*$gdb_prompt $" { pass "maint info sections DATA" }
     -re ".* .rodata .*$gdb_prompt $" { pass "maint info sections DATA" }
     -re ".*$gdb_prompt $"          { fail "maint info sections DATA" }
     timeout              { fail "(timeout) maint info sections DATA" }
Index: gdb-mainline/gdb/testsuite/gdb.base/pointers.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/pointers.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/pointers.exp	2010-03-24 13:45:12.000000000 -0700
@@ -600,4 +600,4 @@ gdb_expect {
 # Regression test for a crash.
 
 gdb_test "p instance.array_variable + 0" \
-  " = \\(long int \\*\\) 0x\[0-9a-f\]*"
+  " = \\(long (int )?\\*\\) 0x\[0-9a-f\]*"
Index: gdb-mainline/gdb/testsuite/gdb.base/printcmds.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/printcmds.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/printcmds.exp	2010-03-24 13:45:12.000000000 -0700
@@ -36,6 +36,8 @@ if  { [gdb_compile "${srcdir}/${subdir}/
      return -1
 }
 
+get_compiler_info ${binfile}
+
 # Set the current language to C.  This counts as a test.  If it
 # fails, then we skip the other tests.
 
@@ -777,6 +779,12 @@ gdb_test "set print address off" ""
 gdb_test "set width 0" ""
 
 if [set_lang_c] then {
+    if { [test_compiler_info "armcc-*"] } {
+	# ARM RealView compresses large arrays in the data segment.
+	# Before the program starts, we can not read them.  There is
+	# nothing in the file to indicate that data is compressed.
+	setup_xfail "arm*-*-eabi"
+    }
     gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1"
 
     gdb_load ${binfile}
Index: gdb-mainline/gdb/testsuite/gdb.base/step-line.exp
===================================================================
--- gdb-mainline.orig/gdb/testsuite/gdb.base/step-line.exp	2010-03-24 12:39:17.000000000 -0700
+++ gdb-mainline/gdb/testsuite/gdb.base/step-line.exp	2010-03-24 13:45:12.000000000 -0700
@@ -47,7 +47,7 @@ if ![runto_main] then {
 
 set remote_linefile [remote_download host ${srcdir}/${subdir}/${linefile}]
 
-gdb_test "break f1" ".*Breakpoint 2 at .* file step-line.c.*" "break f1"
+gdb_test "break f1" ".*Breakpoint 2 at .* file .*step-line.c.*" "break f1"
 gdb_test "continue" \
          "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
 	 "continue to f1"


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