public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix options arg handling in compile_jit_elf_main_as_so
@ 2021-12-07  8:44 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-12-07  8:44 UTC (permalink / raw)
  To: gdb-patches

In commit 80ad340c902 ("[gdb/testsuite] use -Ttext-segment for jit-elf tests")
the following change was made:
...
 proc compile_jit_elf_main_as_so {main_solib_srcfile main_solib_binfile options} {
-    set options [concat $options debug]
+    global jit_load_address jit_load_increment
+
+    set options [list \
+       additional_flags="-DMAIN=jit_dl_main" \
+       additional_flags=-DLOAD_ADDRESS=$jit_load_address \
+       additional_flags=-DLOAD_INCREMENT=$jit_load_increment \
+       debug]
...

Before the change, the options argument was used, but after the change not
anymore.

Fix this by reverting back to using "set options [concat $options ...]".

Fixing this gets us twice the -DMAIN=jit_dl_main bit, once from a caller, and
once from compile_jit_elf_main_as_so.  Fix this by removing the bit from
compile_jit_elf_main_as_so, which makes the code similar to compile_jit_main.

Tested on x86_64-linux.
---
 gdb/testsuite/lib/jit-elf-helpers.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/jit-elf-helpers.exp b/gdb/testsuite/lib/jit-elf-helpers.exp
index 06f7103cff3..8ff41a36324 100644
--- a/gdb/testsuite/lib/jit-elf-helpers.exp
+++ b/gdb/testsuite/lib/jit-elf-helpers.exp
@@ -55,8 +55,8 @@ proc compile_jit_main {main_srcfile main_binfile options} {
 proc compile_jit_elf_main_as_so {main_solib_srcfile main_solib_binfile options} {
     global jit_load_address jit_load_increment
 
-    set options [list \
-	additional_flags="-DMAIN=jit_dl_main" \
+    set options [concat \
+	$options \
 	additional_flags=-DLOAD_ADDRESS=$jit_load_address \
 	additional_flags=-DLOAD_INCREMENT=$jit_load_increment \
 	debug]

base-commit: c178f2a133740e64344da6484f71807f236a3c00
-- 
2.31.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-07  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  8:44 [pushed] [gdb/testsuite] Fix options arg handling in compile_jit_elf_main_as_so Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).