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

Unified Diff: gdb/testsuite/gdb.python/py-frame.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.python/py-finish-breakpoint2.py ('k') | gdb/testsuite/gdb.python/py-frame-args.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.python/py-frame.exp
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index 993e77479fb193f890d21f8323074997f0c65bb9..63e4afb22d19961e36ad3048c67dd12b6663e3f0 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+# Copyright (C) 2009-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
@@ -38,25 +38,29 @@ gdb_breakpoint [gdb_get_line_number "Block break here."]
gdb_continue_to_breakpoint "Block break here."
gdb_py_test_silent_cmd "python bf1 = gdb.selected_frame ()" "get frame" 0
+# Test Frame.architecture() method.
+gdb_py_test_silent_cmd "python show_arch_str = gdb.execute(\"show architecture\", to_string=True)" "show arch" 0
+gdb_test "python print (bf1.architecture().name() in show_arch_str)" "True" "test Frame.architecture()"
+
# First test that read_var is unaffected by PR 11036 changes.
-gdb_test "python print bf1.read_var(\"i\")" "\"stuff\"" "test i"
-gdb_test "python print bf1.read_var(\"f\")" "\"foo\"" "test f"
-gdb_test "python print bf1.read_var(\"b\")" "\"bar\"" "test b"
+gdb_test "python print (bf1.read_var(\"i\"))" "\"stuff\"" "test i"
+gdb_test "python print (bf1.read_var(\"f\"))" "\"foo\"" "test f"
+gdb_test "python print (bf1.read_var(\"b\"))" "\"bar\"" "test b"
# Test the read_var function in another block other than the current
# block (in this case, the super block). Test thar read_var is reading
# the correct variables of i and f but they are the correct value and type.
gdb_py_test_silent_cmd "python sb = bf1.block().superblock" "get superblock" 0
-gdb_test "python print bf1.read_var(\"i\", sb)" "1.1.*" "test i = 1.1"
-gdb_test "python print bf1.read_var(\"i\", sb).type" "double" "test double i"
-gdb_test "python print bf1.read_var(\"f\", sb)" "2.2.*" "test f = 2.2"
-gdb_test "python print bf1.read_var(\"f\", sb).type" "double" "test double f"
+gdb_test "python print (bf1.read_var(\"i\", sb))" "1.1.*" "test i = 1.1"
+gdb_test "python print (bf1.read_var(\"i\", sb).type)" "double" "test double i"
+gdb_test "python print (bf1.read_var(\"f\", sb))" "2.2.*" "test f = 2.2"
+gdb_test "python print (bf1.read_var(\"f\", sb).type)" "double" "test double f"
# And again test another outerblock, this time testing "i" is the
# correct value and type.
gdb_py_test_silent_cmd "python sb = sb.superblock" "get superblock" 0
-gdb_test "python print bf1.read_var(\"i\", sb)" "99" "test i = 99"
-gdb_test "python print bf1.read_var(\"i\", sb).type" "int" "test int i"
+gdb_test "python print (bf1.read_var(\"i\", sb))" "99" "test i = 99"
+gdb_test "python print (bf1.read_var(\"i\", sb).type)" "int" "test int i"
gdb_breakpoint "f2"
gdb_continue_to_breakpoint "breakpoint at f2"
@@ -67,26 +71,26 @@ gdb_test "up" ".*" ""
gdb_py_test_silent_cmd "python f1 = gdb.selected_frame ()" "get second frame" 0
gdb_py_test_silent_cmd "python f0 = f1.newer ()" "get first frame" 0
-gdb_test "python print f1 == gdb.newest_frame()" False \
+gdb_test "python print (f1 == gdb.newest_frame())" False \
"selected frame -vs- newest frame"
-gdb_test "python print bframe == gdb.newest_frame()" True \
+gdb_test "python print (bframe == gdb.newest_frame())" True \
"newest frame -vs- newest frame"
-gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)"
-gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)"
-gdb_test "python print 'result =', f0 != f1" " = True" "test inequality comparison (true)"
-gdb_test "python print 'result =', f0 != f0" " = False" "test inequality comparison (false)"
-gdb_test "python print 'result =', f0.is_valid ()" " = True" "test Frame.is_valid"
-gdb_test "python print 'result =', f0.name ()" " = f2" "test Frame.name"
-gdb_test "python print 'result =', f0.type () == gdb.NORMAL_FRAME" " = True" "test Frame.type"
-gdb_test "python print 'result =', f0.unwind_stop_reason () == gdb.FRAME_UNWIND_NO_REASON" " = True" "test Frame.type"
-gdb_test "python print 'result =', gdb.frame_stop_reason_string (gdb.FRAME_UNWIND_INNER_ID)" " = previous frame inner to this frame \\(corrupt stack\\?\\)" "test gdb.frame_stop_reason_string"
-gdb_test "python print 'result =', f0.pc ()" " = \[0-9\]+" "test Frame.pc"
-gdb_test "python print 'result =', f0.older () == f1" " = True" "test Frame.older"
-gdb_test "python print 'result =', f1.newer () == f0" " = True" "test Frame.newer"
-gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_exist')" \
+gdb_test "python print ('result = %s' % (f0 == f1))" " = False" "test equality comparison (false)"
+gdb_test "python print ('result = %s' % (f0 == f0))" " = True" "test equality comparison (true)"
+gdb_test "python print ('result = %s' % (f0 != f1))" " = True" "test inequality comparison (true)"
+gdb_test "python print ('result = %s' % (f0 != f0))" " = False" "test inequality comparison (false)"
+gdb_test "python print ('result = %s' % f0.is_valid ())" " = True" "test Frame.is_valid"
+gdb_test "python print ('result = %s' % f0.name ())" " = f2" "test Frame.name"
+gdb_test "python print ('result = %s' % (f0.type () == gdb.NORMAL_FRAME))" " = True" "test Frame.type"
+gdb_test "python print ('result = %s' % (f0.unwind_stop_reason () == gdb.FRAME_UNWIND_NO_REASON))" " = True" "test Frame.type"
+gdb_test "python print ('result = %s' % gdb.frame_stop_reason_string (gdb.FRAME_UNWIND_INNER_ID))" " = previous frame inner to this frame \\(corrupt stack\\?\\)" "test gdb.frame_stop_reason_string"
+gdb_test "python print ('result = %s' % f0.pc ())" " = \[0-9\]+" "test Frame.pc"
+gdb_test "python print ('result = %s' % (f0.older () == f1))" " = True" "test Frame.older"
+gdb_test "python print ('result = %s' % (f1.newer () == f0))" " = True" "test Frame.newer"
+gdb_test "python print ('result = %s' % f0.read_var ('variable_which_surely_doesnt_exist'))" \
"ValueError: Variable 'variable_which_surely_doesnt_exist' not found.*Error while executing Python code." \
"test Frame.read_var - error"
-gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success"
+gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.read_var - success"
-gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame"
+gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame"
« no previous file with comments | « gdb/testsuite/gdb.python/py-finish-breakpoint2.py ('k') | gdb/testsuite/gdb.python/py-frame-args.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698