* gdb.python/py-symbol.exp: Use lookup_global_symbol for tests

before inferior is started.
This commit is contained in:
Tom Tromey 2012-02-08 19:58:25 +00:00
parent 1a119f3613
commit 09fa21bd6f
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2012-02-08 Tom Tromey <tromey@redhat.com>
* gdb.python/py-symbol.exp: Use lookup_global_symbol for tests
before inferior is started.
2012-02-07 Tom Tromey <tromey@redhat.com>
* gdb.python/py-symbol.exp: Test Symbol.needs_frame and

View File

@ -42,17 +42,18 @@ gdb_py_test_silent_cmd "python main_func = gdb.lookup_global_symbol(\"main\")" "
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\")"
gdb_test "python print gdb.lookup_symbol('main')\[0\].value()" "$hex .main." \
gdb_test "python print gdb.lookup_global_symbol('main').value()" "$hex .main." \
"print value of main"
set qq_line [gdb_get_line_number "line of qq"]
gdb_test "python print gdb.lookup_symbol('qq')\[0\].line" "$qq_line" \
gdb_test "python print gdb.lookup_global_symbol('qq').line" "$qq_line" \
"print line number of qq"
gdb_test "python print gdb.lookup_symbol('qq')\[0\].value()" "72" \
gdb_test "python print gdb.lookup_global_symbol('qq').value()" "72" \
"print value of qq"
gdb_test "python print gdb.lookup_symbol('qq')\[0\].needs_frame" "False" \
gdb_test "python print gdb.lookup_global_symbol('qq').needs_frame" \
"False" \
"print whether qq needs a frame"