Rename python function thread_from_thread_handle to thread_from_handle
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-thrhandle.exp
index 57b97faa1836b020c69ff4f403afc4cedb08bdae..19c690be14ad39e09614a8a6ab52a1ec154e2202 100644 (file)
@@ -16,7 +16,7 @@
 # Please email any bugs, comments, and/or additions to this file to:
 # bug-gdb@gnu.org
 
-# This file verifies that methods Inferior.thread_from_thread_handle
+# This file verifies that methods Inferior.thread_from_handle
 # and InferiorThread.handle work as expected.
 
 load_lib gdb-python.exp
@@ -67,44 +67,44 @@ gdb_test "info threads"  \
        {.*[\r\n]+\* +([0-9]+) +Thread[^\r\n]* do_something \(n=\1\) at.*}
 
 # Check for expected results when passing a valid thread handle to
-# thread_from_thread_handle().
+# thread_from_handle().
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs\[0\]')).num)" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs\[0\]')).num)" \
        "1" "print thread id for thrs\[0\]"
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs\[1\]')).num)" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs\[1\]')).num)" \
        "2" "print thread id for thrs\[1\]"
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs\[2\]')).num)" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs\[2\]')).num)" \
        "3" "print thread id for thrs\[2\]"
 
 # Objects which are of the correct size, but which are bogus thread
 # handles should return None.  For the first test (using thrs[3]), we
 # use 0.  For the second (thrs[4]), we use an unlikely bit pattern.
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs\[3\]')))" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs\[3\]')))" \
        "None" "print thread for bogus handle thrs\[3\]"
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs\[4\]')))" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs\[4\]')))" \
        "None" "print thread for bogus handle thrs\[4\]"
 
 # We should see an exception when passing an object of the wrong type.
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.lookup_symbol('main')))" \
-         ".*TypeError: Argument 'handle_obj' must be a thread handle object.*" \
-        "TypeError when passing a symbol object to thread_from_thread_handle"
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.lookup_symbol('main')))" \
+         ".*TypeError: Argument 'handle' must be a thread handle object.*" \
+        "TypeError when passing a symbol object to thread_from_handle"
 
 # We should see an exception when passing too large of an object.
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('thrs')))" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('thrs')))" \
          ".*Thread handle size mismatch.*" \
-        "Pass overly large object to thread_from_thread_handle"
+        "Pass overly large object to thread_from_handle"
 
 # We should see an exception when passing too small of an object.
 
-gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('\"S\"')))" \
+gdb_test "python print(gdb.selected_inferior().thread_from_handle(gdb.parse_and_eval('\"S\"')))" \
          ".*Thread handle size mismatch.*" \
-        "Pass too small of an object to thread_from_thread_handle"
+        "Pass too small of an object to thread_from_handle"
 
 # Test the thread_handle method
 
@@ -121,7 +121,7 @@ foreach thrN {0 1 2} {
            1
 
        gdb_py_test_silent_cmd \
-           "python hand_bytes = inf.thread_from_thread_handle(hand).handle()" \
+           "python hand_bytes = inf.thread_from_handle(hand).handle()" \
            "fetch thread handle from thread" \
            1
 
This page took 0.024818 seconds and 4 git commands to generate.