diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-symbol.exp | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 86a176c..f7dbde4 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-02-22 Doug Evans <dje@google.com> + + * gdb.python/py-symbol.exp: Test lookup_global_symbol. + 2011-02-22 Michael Snyder <msnyder@vmware.com> * Makefile.in: Make more clean. diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp index 8e3aec1..b30c639 100644 --- a/gdb/testsuite/gdb.python/py-symbol.exp +++ b/gdb/testsuite/gdb.python/py-symbol.exp @@ -39,6 +39,13 @@ gdb_load ${binfile} # Skip all tests if Python scripting is not enabled. if { [skip_python_tests] } { continue } +# Test looking up a global symbol before we runto_main as this is the +# point where we don't have a current frame, and we don't want to +# require one. +gdb_py_test_silent_cmd "python main_func = gdb.lookup_global_symbol(\"main\")" "Lookup main" 1 +gdb_test "python print main_func.is_function" "True" "Test main_func.is_function" +gdb_test "python print gdb.lookup_global_symbol(\"junk\")" "None" "Test lookup_global_symbol(\"junk\")" + if ![runto_main] then { fail "Can't run to main" return 0 |