Use target_sim_options when selecting sim as target

Message ID 041e01d1f25b$b57ed930$207c8b90$@beniston.com
State New, archived
Headers

Commit Message

Jon Beniston Aug. 9, 2016, 4:33 p.m. UTC
  Hi,

The following patch uses target_sim_options from the board info when
selecting the sim target. This is set in some of the sim baseboards, and can
be needed to configure the simulator appropriately.

Cheers,
Jon

2016-0-09  Jon Beniston  <jon@beniston.com>

	* gdb/testsuite/lib/mi-support.exp (mi_gdb_target_load): Use
target_sim_options for sim target.
  

Comments

Pedro Alves Aug. 9, 2016, 4:45 p.m. UTC | #1
On 08/09/2016 05:33 PM, Jon Beniston wrote:
> Hi,
> 
> The following patch uses target_sim_options from the board info when
> selecting the sim target. This is set in some of the sim baseboards, and can
> be needed to configure the simulator appropriately.

Looks obvious, given that the corresponding CLI code already
does the same thing.


> 2016-0-09  Jon Beniston  <jon@beniston.com>

(Typo in date.)

> 
> 	* gdb/testsuite/lib/mi-support.exp (mi_gdb_target_load): Use
> target_sim_options for sim target.

Note there's a ChangeLog file in gdb/testsuite/.  So please write the
path relative to the corresponding ChangeLog file:

gdb/testsuite/ChangeLog:
2016-08-09  Jon Beniston  <jon@beniston.com>

	* lib/mi-support.exp (mi_gdb_target_load): ...

OK with that change.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/testsuite/lib/mi-support.exp
b/gdb/testsuite/lib/mi-support.exp
index 28af70a..3507b5b 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -602,8 +602,9 @@  proc mi_gdb_target_load { } {
            }
        }
     } elseif { [target_info protocol] == "sim" } {
+       set target_sim_options "[board_info target gdb,target_sim_options]"
        # For the simulator, just connect to it directly.
-       send_gdb "47-target-select sim\n"
+       send_gdb "47-target-select sim $target_sim_options\n"
        gdb_expect $loadtimeout {
            -re "47\\^connected.*$mi_gdb_prompt$" {
            }