[PATCH 09/12] gdb_target_is_native -> gdb_protocol_is_native

Pedro Alves pedro@palves.net
Thu May 9 12:05:24 GMT 2024


On 2024-05-09 12:54, Bernd Edlinger wrote:
> On 5/9/24 11:47, Pedro Alves wrote:
> I think that file would be used when I run the gcc testsuite,
> there I set the path to my riscv-toolchain,
> and invoke this in the gcc-build directory:
> make check -i RUNTESTFLAGS="--target_board=multi-sim SIM=riscv-unknown-elf-run"
> or SIM=qemu-riscv32 for comparison.
> 
> But if I run the gdb testsuite I can do the same, but the SIM=parameter I could even
> use SIM=true, is only a dummy, it must be executable, but it is not used in the end.
> And I believe for gdb the following file is picked up instead:
> 
> binutils-gdb/gdb/testsuite/config/sim.exp
> 

Ah, OK, that makes a lot more sense.  I got confused with the "multi-sim" thing.

Since it's our file, it makes it makes easier.

I guess we should try sticking:

 set_board_info gdb_protocol "sim"

in that file.  Like the patchlet below.  Could you give it a try, please?

>From 843a53be479e22926a3dbecc76c5de6160796af4 Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Thu, 9 May 2024 13:01:53 +0100
Subject: [PATCH] gdb_protocol sim

Change-Id: I48a7afed004a3517b90220674fe5bc856fe7d09a
---
 gdb/testsuite/config/sim.exp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gdb/testsuite/config/sim.exp b/gdb/testsuite/config/sim.exp
index 81736d25814..da2780e1d47 100644
--- a/gdb/testsuite/config/sim.exp
+++ b/gdb/testsuite/config/sim.exp
@@ -14,6 +14,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# If we left this empty, the core of the testsuite would think we were
+# connecting to the native target.
+set_board_info gdb_protocol "sim"
+
 #
 # gdb_target_sim
 # Set gdb to target the simulator

base-commit: 5021daf303393722f58f4422d7ad53d526aa2d50
-- 
2.43.2




More information about the Gdb-patches mailing list