Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ilya Leoshkevich via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tromey@adacore.com>, Andrew Burgess <aburgess@redhat.com>
Cc: Ulrich Weigand <ulrich.weigand@de.ibm.com>,
	Andreas Arnez <arnez@linux.ibm.com>,
	gdb-patches@sourceware.org, Pedro Alves <pedro@palves.net>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: [PATCH v2 5/7] gdb.base/: Introduce jit_compile_options
Date: Tue, 31 May 2022 00:11:45 +0200	[thread overview]
Message-ID: <20220530221147.1991835-6-iii@linux.ibm.com> (raw)
In-Reply-To: <20220530221147.1991835-1-iii@linux.ibm.com>

Move setting LOAD_ADDRESS and LOAD_INCREMENT to a separate global
variable.  This eliminates repetition and is useful for sharing with
performance tests.  Also make them unsigned long long in order to
prevent overflows when using a lot of shared libraries.
---
 gdb/testsuite/lib/jit-elf-helpers.exp | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/lib/jit-elf-helpers.exp b/gdb/testsuite/lib/jit-elf-helpers.exp
index b699917f209..7c17178f800 100644
--- a/gdb/testsuite/lib/jit-elf-helpers.exp
+++ b/gdb/testsuite/lib/jit-elf-helpers.exp
@@ -19,6 +19,9 @@
 
 set jit_load_address   0x7000000
 set jit_load_increment 0x1000000
+set jit_compile_options [list \
+    additional_flags=-DLOAD_ADDRESS=${jit_load_address}ull \
+    additional_flags=-DLOAD_INCREMENT=${jit_load_increment}ull]
 
 # Compile jit-elf-main.c as an executable.
 #
@@ -28,12 +31,11 @@ set jit_load_increment 0x1000000
 # On success, return 0.
 # On failure, return -1.
 proc compile_jit_main {main_srcfile main_binfile options} {
-    global jit_load_address jit_load_increment
+    global jit_compile_options
 
     set options [concat \
 	$options \
-	additional_flags=-DLOAD_ADDRESS=$jit_load_address \
-	additional_flags=-DLOAD_INCREMENT=$jit_load_increment \
+	$jit_compile_options \
 	debug]
 
     if { [gdb_compile ${main_srcfile} ${main_binfile} \
@@ -53,12 +55,11 @@ proc compile_jit_main {main_srcfile main_binfile options} {
 # On success, return 0.
 # On failure, return -1.
 proc compile_jit_elf_main_as_so {main_solib_srcfile main_solib_binfile options} {
-    global jit_load_address jit_load_increment
+    global jit_compile_options
 
     set options [concat \
 	$options \
-	additional_flags=-DLOAD_ADDRESS=$jit_load_address \
-	additional_flags=-DLOAD_INCREMENT=$jit_load_increment \
+	$jit_compile_options \
 	debug]
 
     if { [gdb_compile_shlib ${main_solib_srcfile} ${main_solib_binfile} \
-- 
2.35.3


  parent reply	other threads:[~2022-05-30 22:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 22:11 [PATCH v2 0/7] gdb.perf/: Add JIT performance test Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 1/7] gdb.perf/: Fix tcl_string_list_to_python_list {x} Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 2/7] gdb.perf/: Add binary_link_with_shlibs setting to GenPerfTest Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 3/7] gdb.perf/: Allow adjusting GenPerfTest compile options Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 4/7] gdb.base/: Introduce jit-protocol-util.h Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` Ilya Leoshkevich via Gdb-patches [this message]
2022-05-30 22:11 ` [PATCH v2 6/7] gdb.base/: Introduce n_jit_so_address Ilya Leoshkevich via Gdb-patches
2022-05-30 22:11 ` [PATCH v2 7/7] gdb.perf/: Add JIT performance test Ilya Leoshkevich via Gdb-patches
2022-06-22  8:48 ` [PING] [PATCH v2 0/7] " Ilya Leoshkevich via Gdb-patches
2022-08-03 10:52 ` [PING^2] " Ilya Leoshkevich via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220530221147.1991835-6-iii@linux.ibm.com \
    --to=gdb-patches@sourceware.org \
    --cc=aburgess@redhat.com \
    --cc=arnez@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=pedro@palves.net \
    --cc=tromey@adacore.com \
    --cc=ulrich.weigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox