-# Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2008-2014 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
# This file is part of the GDB testsuite. It tests Python-based
# pretty-printing for the CLI.
-if $tracelevel then {
- strace $tracelevel
-}
-
load_lib gdb-python.exp
-set testfile "py-prettyprint"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
# Start with a fresh gdb.
gdb_exit
".*Breakpoint.*"
gdb_test "continue" ".*Breakpoint.*"
- set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
+ set remote_python_file [gdb_remote_download host \
+ ${srcdir}/${subdir}/${testfile}.py]
- gdb_test_no_output "python execfile ('${remote_python_file}')"
+ gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+ "python exec (open ('[file tail ${remote_python_file}]').read ())"
gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>"
gdb_test "print ssa\[1\]" " = a=< a=<5> b=<$hex>> b=< a=<6> b=<$hex>>"
gdb_py_test_silent_cmd "set print elements 200" "" 1
}
- gdb_test "print ns2" ".error reading variable: Address 0x0 out of bounds."
+ gdb_test "print ns2" ".error reading variable: Cannot access memory at address 0x0."
gdb_test "print x" " = \"this is x\""
gdb_test "print cstring" " = \"const string\""
return
}
+set remote_python_file [gdb_remote_download host \
+ ${srcdir}/${subdir}/${testfile}.py]
+
+gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+ "python exec (open ('[file tail ${remote_python_file}]').read ())"
+
+gdb_breakpoint [gdb_get_line_number "eval-break"]
+gdb_continue_to_breakpoint "eval-break" ".* eval-break .*"
+
+gdb_test "info locals" "eval9 = eval=<123456789>"
+
gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \
".*Breakpoint.*"
gdb_test "continue" ".*Breakpoint.*"
-set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
-
-gdb_test_no_output "python execfile ('${remote_python_file}')"
-
gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>" \
"print ss enabled #1"