This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/4] Tests for gdb.InfThread.thread_handle


gdb/testsuite/ChangeLog:
    
    	* gdb.python/py-thrhandle.exp: Add tests for
    	gdb.InfThread.thread_handle.
---
 gdb/testsuite/gdb.python/py-thrhandle.exp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gdb/testsuite/gdb.python/py-thrhandle.exp b/gdb/testsuite/gdb.python/py-thrhandle.exp
index 49aa97c..b3caaf5 100644
--- a/gdb/testsuite/gdb.python/py-thrhandle.exp
+++ b/gdb/testsuite/gdb.python/py-thrhandle.exp
@@ -104,3 +104,17 @@ gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.par
 gdb_test "python print(gdb.selected_inferior().thread_from_thread_handle(gdb.parse_and_eval('\"S\"')))" \
          ".*Thread handle size mismatch.*" \
 	 "Pass too small of an object to thread_from_thread_handle"
+
+# Test the thread_handle method
+
+gdb_test "python h=gdb.parse_and_eval('thrs\[0\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \
+         "True" \
+	 "Check operation of thread_handle method for thrs\[0\]"
+
+gdb_test "python h=gdb.parse_and_eval('thrs\[1\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \
+         "True" \
+	 "Check operation of thread_handle method for thrs\[1\]"
+
+gdb_test "python h=gdb.parse_and_eval('thrs\[2\]');print(gdb.selected_inferior().thread_from_thread_handle(h)).thread_handle(gdb.lookup_type('pthread_t'))==h" \
+         "True" \
+	 "Check operation of thread_handle method for thrs\[2\]"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]