This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 8/8] Control agent in testsuite
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 23 Jan 2012 22:29:08 +0800
- Subject: [patch 8/8] Control agent in testsuite
- References: <4F1D55D7.7030506@codesourcery.com>
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