* gdb.python/py-symbol.exp: Use lookup_global_symbol for tests
authorTom Tromey <tromey@redhat.com>
Wed, 8 Feb 2012 19:58:25 +0000 (19:58 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 8 Feb 2012 19:58:25 +0000 (19:58 +0000)
before inferior is started.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-symbol.exp

index 4fd340c..556e7e0 100644 (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
index 0f5eb3c..2f274af 100644 (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"