test: cover subranges with present DW_AT_count attribute
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-prettyprint.exp
index 9786d714e7eb500b54a7d18bb892c9956a3719c2..491b52d551efb3c8912689e9758080859d171f15 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -59,9 +53,11 @@ proc run_lang_tests {exefile lang} {
        ".*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>>"
@@ -87,7 +83,7 @@ proc run_lang_tests {exefile lang} {
        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\""
@@ -129,14 +125,21 @@ if ![runto_main ] then {
     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"
 
This page took 0.025015 seconds and 4 git commands to generate.