[patch 8/8] Control agent in testsuite

Yao Qi
2012-01-23T14:29:29Z

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

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 (é½å°§)

[-- Attachment #2: 0008-set-agent-on-in-board-file.patch --]
[-- Type: text/x-patch, Size: 1031 bytes --]

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