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 8/8] Control agent in testsuite


After using agent, we need to run testsuite in two cases, agent is on
and off.  This patch is to add such logic in testsuite, so that we can
control this through board file.  If we add the following line in board
file,

  set_board_info use_agent "on"

the agent is always turned on for remote testing.  We need also to turn
agent on in native debugging, but I'll postpone it when gdb starts to
use agent.

-- 
Yao (éå)
2012-01-22  Yao Qi  <yao@codesourcery.com>

	* lib/gdbserver-support.exp (gdbserver_run): Set agent on or off if use_agent
	exits in board file.
---
 gdb/testsuite/lib/gdbserver-support.exp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
index 11d9107..e72fc36 100644
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -337,7 +337,17 @@ proc gdbserver_run { child_args } {
     set gdbserver_protocol [lindex $res 0]
     set gdbserver_gdbport [lindex $res 1]
 
-    return [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport]
+    set ret [gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport]
+
+    if [target_info exists use_agent] {
+	send_gdb "set agent [target_info use_agent]\n"
+	gdb_expect 120 {
+	    -re "^set agent \(on|off\)\r\n$gdb_prompt $" {
+	    }
+	}
+    }
+
+    return $ret
 }
 
 # Reconnect to the previous gdbserver session.
-- 
1.7.0.4


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