From 293e2f9ec5c6d0bf16db402c8f2d955b51299a6c Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 24 Mar 2010 21:28:14 +0000 Subject: [PATCH] * 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/ChangeLog | 11 +++++++++++ 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 +- 8 files changed, 42 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d031729..78170b2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2010-03-24 Daniel Jacobowitz + + * 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. + 2010-03-24 Tom Tromey PR breakpoints/9352: diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index 53d021a..8b1e09a 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -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'"} diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp index 7312f49..a60e704 100644 --- a/gdb/testsuite/gdb.base/ending-run.exp +++ b/gdb/testsuite/gdb.base/ending-run.exp @@ -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" } diff --git a/gdb/testsuite/gdb.base/gdbvars.c b/gdb/testsuite/gdb.base/gdbvars.c index 3a3ba24..aa3b4d8 100644 --- a/gdb/testsuite/gdb.base/gdbvars.c +++ b/gdb/testsuite/gdb.base/gdbvars.c @@ -7,10 +7,6 @@ ptr p = &p; int main () { -#ifdef usestubs - set_debug_traps (); - breakpoint (); -#endif - + p = &p; return 0; } diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index 0707c88..4969c67 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -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
# 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" } diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index 38e7340..4b96e7e 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -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\]*" diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index ba1c3d7..6dd28a7 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -36,6 +36,8 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb 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} diff --git a/gdb/testsuite/gdb.base/step-line.exp b/gdb/testsuite/gdb.base/step-line.exp index 699be96..c38b558 100644 --- a/gdb/testsuite/gdb.base/step-line.exp +++ b/gdb/testsuite/gdb.base/step-line.exp @@ -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" -- 2.7.4