[PATCH 1/2] [gdb/testsuite] optional flags for compile_and_download_n_jit_so

Mihails Strasuns mihails.strasuns@intel.com
Tue May 12 11:33:07 GMT 2020


Allows to pass in optional extra compilation flags to
compile_and_download_n_jit_so function.

gdb/testsuite/ChangeLog:

2020-05-13  Mihails Strasuns  <mihails.strasuns@intel.com>

	* lib/jit-elf-helpers.exp (compile_and_download_n_jit_so): new
	  optional argument for compiler flags
---
 gdb/testsuite/lib/jit-elf-helpers.exp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/lib/jit-elf-helpers.exp b/gdb/testsuite/lib/jit-elf-helpers.exp
index ab647abe50..2f6aa73414 100644
--- a/gdb/testsuite/lib/jit-elf-helpers.exp
+++ b/gdb/testsuite/lib/jit-elf-helpers.exp
@@ -72,9 +72,12 @@ proc compile_jit_elf_main_as_so {main_solib_srcfile main_solib_binfile options}
 # Compile jit-elf-solib.c as a shared library in multiple copies and
 # upload them to the target.
 #
+# EXTRA_OPTIONS may be passed as an optional argument to be added to
+# the compilation options.
+#
 # On success, return a list of target path to the shared libraries.
 # On failure, return -1.
-proc compile_and_download_n_jit_so {jit_solib_basename jit_solib_srcfile count} {
+proc compile_and_download_n_jit_so {jit_solib_basename jit_solib_srcfile count {extra_options}} {
     global jit_load_address jit_load_increment
     set binfiles_target {}
 
@@ -93,7 +96,8 @@ proc compile_and_download_n_jit_so {jit_solib_basename jit_solib_srcfile count}
 	set options [list \
 	    additional_flags=-DFUNCTION_NAME=[format "jit_function_%04d" $i] \
 	    additional_flags=-Xlinker \
-	    additional_flags=-Ttext-segment=$addr]
+	    additional_flags=-Ttext-segment=$addr \
+	    $extra_options]
 	if { [gdb_compile_shlib ${jit_solib_srcfile} ${binfile} $options] != "" } {
 	    untested "failed to compile ${jit_solib_basename}.c as a shared library"
 	    return -1
-- 
2.26.2

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Gary Kershaw
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928



More information about the Gdb-patches mailing list