aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-03-24 21:06:33 +0000
committerDaniel Jacobowitz <drow@false.org>2010-03-24 21:06:33 +0000
commita6c727b2f1c9804ca95ebc61de518246d03abb37 (patch)
tree6ba99723ff001306b83dbd7a030dbd4a2835505f /gdb/testsuite
parent0d39a07082291dc1bfc36568ea6a60a78739db41 (diff)
downloadgdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.zip
gdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.tar.gz
gdb-a6c727b2f1c9804ca95ebc61de518246d03abb37.tar.bz2
* dwarf2-frame.c (dwarf2_frame_find_quirks): Use producer_is_realview.
* dwarf2read.c (load_full_comp_unit): Read DW_AT_producer. (read_structure_type): For RealView, set TYPE_STUB on structures with no byte size and no children. (read_subroutine_type): Mark functions as prototyped by default. * symtab.c (producer_is_realview): New function. * symtab.h (expand_line_sal): Fix declaration formatting. (producer_is_realview): Declare. testsuite/ * gdb.base/callfuncs.exp (do_function_calls): Add XFAILs for RealView. * gdb.base/ptype.exp (ptype_maybe_prototyped): Add overprototyped argument. Handle "short" and "long". (Top level): Pass overprototyped output for old_fptr and xptr.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp6
-rw-r--r--gdb/testsuite/gdb.base/ptype.exp28
3 files changed, 35 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ad3e193..c987796 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-24 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.base/callfuncs.exp (do_function_calls): Add XFAILs for RealView.
+ * gdb.base/ptype.exp (ptype_maybe_prototyped): Add overprototyped
+ argument. Handle "short" and "long".
+ (Top level): Pass overprototyped output for old_fptr and xptr.
+
2010-03-23 Pedro Alves <pedro@codesourcery.com>
* gdb.threads/pthreads.c (thread1, thread2, main): Fix printf
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
index 9aeb09b..2f175e0 100644
--- a/gdb/testsuite/gdb.base/callfuncs.exp
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -129,13 +129,19 @@ proc do_function_calls {} {
# Gcc emits different stabs for the two parameters; the first is
# claimed to be a float, the second a double.
# dbxout.c in gcc claims this is the desired behavior.
+ # These tests also fail for RealView, because GDB can not tell that
+ # the function is unprototyped.
setup_xfail "mn10300-*-*"
+ if { [test_compiler_info "armcc-*"] } { setup_xfail "*-*-*" }
gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
setup_xfail "mn10300-*-*"
+ if { [test_compiler_info "armcc-*"] } { setup_xfail "*-*-*" }
gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
setup_xfail "mn10300-*-*"
+ if { [test_compiler_info "armcc-*"] } { setup_xfail "*-*-*" }
gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
setup_xfail "mn10300-*-*"
+ if { [test_compiler_info "armcc-*"] } { setup_xfail "*-*-*" }
gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
# Test passing of arguments which might not be widened.
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
index 43e646d..589be34 100644
--- a/gdb/testsuite/gdb.base/ptype.exp
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -555,15 +555,23 @@ get_debug_format
# generated by GCC, that's an xfail; as of 9 Feb 2002, GCC never emits
# prototyped function types in STABS. Like PROTOTYPED, PLAIN is a
# literal string, not a regular expression.
+# - If we see OVERPROTOTYPED, it's an xfail for RealView; RealView
+# does not distinguish prototyped and unprototyped functions, and
+# GDB defaults to prototyped.
# - Otherwise, it's a failure.
-proc ptype_maybe_prototyped { id prototyped plain } {
+proc ptype_maybe_prototyped { id prototyped plain { overprototyped "NO-MATCH" } } {
global gdb_prompt
global gcc_compiled
- # Turn `prototyped' and `plain', which are literal strings, into
+ # Turn the arguments, which are literal strings, into
# regular expressions by quoting any special characters they contain.
- regsub -all "\[\]\[*()\]" $prototyped "\\\\&" prototyped
- regsub -all "\[\]\[*()\]" $plain "\\\\&" plain
+ foreach var { prototyped plain overprototyped } {
+ eval "set val \$$var"
+ regsub -all "\[\]\[*()\]" $val "\\\\&" val
+ regsub -all "short int" $val "short( int)?" val
+ regsub -all "long int" $val "long( int)?" val
+ eval "set $var \$val"
+ }
send_gdb "ptype $id\n"
gdb_expect {
@@ -574,6 +582,12 @@ proc ptype_maybe_prototyped { id prototyped plain } {
if {$gcc_compiled} { setup_xfail_format "stabs" }
fail "ptype $id (compiler doesn't emit prototyped types)"
}
+ -re "type = $overprototyped\[\r\n\]+$gdb_prompt $" {
+ if { [test_compiler_info "armcc-*"] } {
+ setup_xfail "*-*-*"
+ }
+ fail "ptype $id (compiler doesn't emit unprototyped types)"
+ }
-re "$gdb_prompt $" {
fail "ptype $id"
}
@@ -585,13 +599,15 @@ proc ptype_maybe_prototyped { id prototyped plain } {
ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
"int (*)()"
-ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()"
+ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()" \
+ "double (*)(void)"
ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
"int *(*)()"
ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
- "int (*)()"
+ "int (*)()" \
+ "int (*)(int (*)(void), int (*)(void), int)"
ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
"int (*(*)())()"
ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \