Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Unified Diff: gdb/testsuite/gdb.base/debug-expr.exp

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/debug-expr.c ('k') | gdb/testsuite/gdb.base/default.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.base/debug-expr.exp
diff --git a/gdb/testsuite/gdb.cp/destrprint.exp b/gdb/testsuite/gdb.base/debug-expr.exp
similarity index 51%
copy from gdb/testsuite/gdb.cp/destrprint.exp
copy to gdb/testsuite/gdb.base/debug-expr.exp
index 23d7e14662132eaf1dbd62a122b6bb12ff705862..958c40af48bf09e57f78e2455245e4df2b5d1ef3 100644
--- a/gdb/testsuite/gdb.cp/destrprint.exp
+++ b/gdb/testsuite/gdb.base/debug-expr.exp
@@ -1,4 +1,4 @@
-# Copyright 2011-2012 Free Software Foundation, Inc.
+# Copyright 2012-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -13,30 +13,40 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-standard_testfile .cc
+# Test "set debug expr 1" on c expressions.
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
+standard_testfile .c
+
+if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug}]} {
return -1
}
if ![runto_main] {
- untested destrprint
+ fail "run to main"
return -1
}
-gdb_breakpoint [gdb_get_line_number "Break here"]
-gdb_continue_to_breakpoint "Break here"
+# Test whether the expression debug machinery accepts the expression.
-gdb_test "up" "#1 .*~Derived.*" "go up to ~Derived"
+proc test_debug_expr { cmd output } {
+ global gdb_prompt
-foreach setting {on off} {
- gdb_test_no_output "set print object $setting"
+ gdb_test_multiple $cmd "" {
+ -re ".*Invalid expression.*\r\n$gdb_prompt $" {
+ fail $cmd
+ }
+ -re ".*\[\r\n\]$output\r\n$gdb_prompt $" {
+ pass $cmd
+ }
+ }
+}
- # Here we are in ~Derived. At this point, Derived has been
- # destroyed, so *this looks like a Base. But, the static type of
- # *this is still Derived, and printing it should show us all the
- # fields, regardless of what "set print object" says.
- gdb_test "print *this" \
- " = .*, z = 23." \
- "print *this with print object = $setting"
+for { set i 0 } { $i < 4 } { incr i } {
+ gdb_test_no_output "set variable array\[$i\] = $i"
}
+
+gdb_test_no_output "set debug expression 1"
+
+# This caused gdb to segfault.
+test_debug_expr "print /x {char\[4\]} array" \
+ "\[$\]$decimal = \\{0x0, 0x1, 0x2, 0x3\\}"
« no previous file with comments | « gdb/testsuite/gdb.base/debug-expr.c ('k') | gdb/testsuite/gdb.base/default.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698