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]

Re: [PATCH] New annotation for threads


 > I'll put it inside a function.  I don't want to create a separate script
 > because I think this test belongs with all the other tests for level 2
 > annotations.

Like below.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


2008-05-20  Nick Roberts  <nickrob@snap.net.nz>

	* gdb.base/annota1.exp (thread_test): Test for new annotation.


--- annota1.exp	17 May 2008 21:09:09 +1200	1.29
+++ annota1.exp	20 May 2008 18:48:14 +1200	
@@ -490,6 +490,45 @@ if [ regexp "core not found" $exec_outpu
     }
 }
 
+proc thread_test {} {
+    global objdir subdir srcdir
+    global gdb_prompt old_gdb_prompt
+    set testfile "watch_thread_num"
+    set srcfile ${testfile}.c
+    set binfile ${objdir}/${subdir}/${testfile}
+    set gdb_prompt $old_gdb_prompt
+
+    if { ![get_compiler_info ${binfile}] && [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] == "" } {
+
+	gdb_exit
+	gdb_start
+	gdb_reinitialize_dir $srcdir/$subdir
+	gdb_load ${binfile}
+	if { ![runto main] } then {
+	    fail "run to main"
+	    return
+	}
+
+	set gdb_prompt \
+	    "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
+
+	send_gdb "set annotate 2\n"
+	gdb_expect {
+	-re "set annotate 2\r\n$gdb_prompt$" {}
+	}
+
+	send_gdb "next 2\n"
+	gdb_expect {
+	    -re ".*\032\032new-thread" {
+	    pass "new thread"
+	    }
+	    timeout { fail "new thread (timeout)" }
+	}
+    }
+}
+
+thread_test
+
 # restore the original prompt for the rest of the testsuite
 
 set gdb_prompt $old_gdb_prompt


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