[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/28] semihosting/config: Merge --semihosting-config option group
From: |
Peter Maydell |
Subject: |
[PULL 28/28] semihosting/config: Merge --semihosting-config option groups |
Date: |
Fri, 10 Jun 2022 17:07:38 +0100 |
Currently we mishandle the --semihosting-config option if the
user specifies it on the command line more than once. For
example with:
--semihosting-config target=gdb --semihosting-config arg=foo,arg=bar
the function qemu_semihosting_config_options() is called twice, once
for each argument. But that function expects to be called only once,
and it always unconditionally sets the semihosting.enabled,
semihost_chardev and semihosting.target variables. This means that
if any of those options were set anywhere except the last
--semihosting-config option on the command line, those settings are
ignored. In the example above, 'target=gdb' in the first option is
overridden by an implied default 'target=auto' in the second.
The QemuOptsList machinery has a flag for handling this kind of
"option group is setting global state": by setting
.merge_lists = true;
we make the machinery merge all the --semihosting-config arguments
the user passes into a single set of options and call our
qemu_semihosting_config_options() just once.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Luc Michel <luc@lmichel.fr>
Message-id: 20220526190053.521505-3-peter.maydell@linaro.org
---
semihosting/config.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/semihosting/config.c b/semihosting/config.c
index 50d82108e6e..3afacf54ab2 100644
--- a/semihosting/config.c
+++ b/semihosting/config.c
@@ -27,6 +27,7 @@
QemuOptsList qemu_semihosting_config_opts = {
.name = "semihosting-config",
+ .merge_lists = true,
.implied_opt_name = "enable",
.head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head),
.desc = {
--
2.25.1
- [PULL 11/28] target/arm: Rename gen_exception_insn to gen_exception_insn_el, (continued)
- [PULL 11/28] target/arm: Rename gen_exception_insn to gen_exception_insn_el, Peter Maydell, 2022/06/10
- [PULL 03/28] target/arm: Move exception_target_el out of line, Peter Maydell, 2022/06/10
- [PULL 06/28] target/arm: Use is_a64 in arm_generate_debug_exceptions, Peter Maydell, 2022/06/10
- [PULL 10/28] target/arm: Introduce gen_exception_insn_el_v, Peter Maydell, 2022/06/10
- [PULL 20/28] target/arm: Remove default_exception_el, Peter Maydell, 2022/06/10
- [PULL 18/28] target/arm: Introduce gen_exception_el_v, Peter Maydell, 2022/06/10
- [PULL 15/28] target/arm: Move gen_exception to translate.c, Peter Maydell, 2022/06/10
- [PULL 23/28] target/arm: Fix Secure PL1 tests in fp_exception_el, Peter Maydell, 2022/06/10
- [PULL 21/28] target/arm: Create raise_exception_debug, Peter Maydell, 2022/06/10
- [PULL 25/28] target/arm: Adjust format test in scr_write, Peter Maydell, 2022/06/10
- [PULL 28/28] semihosting/config: Merge --semihosting-config option groups,
Peter Maydell <=
- [PULL 13/28] target/arm: Create helper_exception_swstep, Peter Maydell, 2022/06/10
- [PULL 14/28] target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL, Peter Maydell, 2022/06/10
- [PULL 16/28] target/arm: Rename gen_exception to gen_exception_el, Peter Maydell, 2022/06/10
- [PULL 19/28] target/arm: Introduce helper_exception_with_syndrome, Peter Maydell, 2022/06/10
- [PULL 07/28] target/arm: Move exception_bkpt_insn to debug_helper.c, Peter Maydell, 2022/06/10
- [PULL 17/28] target/arm: Introduce gen_exception, Peter Maydell, 2022/06/10
- [PULL 26/28] target/arm: SCR_EL3.RW is RAO/WI without AArch32 EL[12], Peter Maydell, 2022/06/10
- [PULL 22/28] target/arm: Move arm_debug_target_el to debug_helper.c, Peter Maydell, 2022/06/10
- [PULL 24/28] tests/qtest: Reduce npcm7xx_sdhci test image size, Peter Maydell, 2022/06/10
- [PULL 27/28] gdbstub: Don't use GDB syscalls if no GDB is attached, Peter Maydell, 2022/06/10