Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 79/79] Consolidate calls to require
Date: Fri, 13 Jan 2023 12:48:49 +0000	[thread overview]
Message-ID: <2e1baa96-5289-537f-5bb4-f128056f6583@palves.net> (raw)
In-Reply-To: <20230112030052.3306113-80-tom@tromey.com>

Hi Tom,

Thanks much for this series.  It's a nice improvement.

I have a comment below.

On 2023-01-12 3:00 a.m., Tom Tromey wrote:
> The previous transforms left some files with multiple calls to
> "require" near the top.  This patch consolidates these to the extent
> possible.  (There are a couple of files that call "require" later,
> after running some tests.  These have been left alone.)


> 
> diff --git a/gdb/testsuite/gdb.ada/catch_ex_std.exp b/gdb/testsuite/gdb.ada/catch_ex_std.exp
> index 73cbdaf90ca..c7b65098208 100644
> --- a/gdb/testsuite/gdb.ada/catch_ex_std.exp
> +++ b/gdb/testsuite/gdb.ada/catch_ex_std.exp
> @@ -13,12 +13,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/>.
>  
> -require allow_shlib_tests
> +require allow_shlib_tests allow_ada_tests
>  
>  load_lib "ada.exp"
>  
> -require allow_ada_tests
> -
>  standard_ada_testfile foo
>  
>  set srcfile2 [file join [file dirname $srcfile] some_package.adb]
> diff --git a/gdb/testsuite/gdb.ada/dynamic-iface.exp b/gdb/testsuite/gdb.ada/dynamic-iface.exp
> index 431fa29d64f..b523968194a 100644
> --- a/gdb/testsuite/gdb.ada/dynamic-iface.exp
> +++ b/gdb/testsuite/gdb.ada/dynamic-iface.exp
> @@ -15,9 +15,7 @@
>  
>  load_lib "ada.exp"
>  
> -require allow_ada_tests
> -
> -require gnat_runtime_has_debug_info
> +require allow_ada_tests gnat_runtime_has_debug_info
>  
>  standard_ada_testfile main
>  
> diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
> index 9e69d136e31..087d1ac9b3d 100644
> --- a/gdb/testsuite/gdb.ada/exec_changed.exp
> +++ b/gdb/testsuite/gdb.ada/exec_changed.exp
> @@ -15,11 +15,9 @@
>  
>  load_lib "ada.exp"
>  
> -require allow_ada_tests
> -
>  # This testcase verifies the behavior of the `start' command, which
>  # does not work when we use the gdb stub...
> -require !use_gdb_stub
> +require allow_ada_tests !use_gdb_stub
>  
>  standard_ada_testfile first


> --- a/gdb/testsuite/gdb.ada/start.exp
> +++ b/gdb/testsuite/gdb.ada/start.exp
> @@ -15,11 +15,9 @@
>  
>  load_lib "ada.exp"
>  
> -require allow_ada_tests
> -
>  # This testcase verifies the behavior of the `start' command, which
>  # does not work when we use the gdb stub...
> -require !use_gdb_stub
> +require allow_ada_tests !use_gdb_stub
>  

...

>  standard_ada_testfile dummy
>  
> diff --git a/gdb/testsuite/gdb.ada/tagged.exp b/gdb/testsuite/gdb.ada/tagged.exp
> index f45a6509da5..a842ed2b6ba 100644



> index fb56d2602b1..970f44da21c 100644
> --- a/gdb/testsuite/gdb.base/async-shell.exp
> +++ b/gdb/testsuite/gdb.base/async-shell.exp
> @@ -15,10 +15,8 @@
>  
>  standard_testfile
>  
> -require support_displaced_stepping
> -
>  # The testfile uses "run".  The real bug happened only for ![is_remote target].
> -require !use_gdb_stub
> +require support_displaced_stepping !use_gdb_stub

I'm not really sure consolidation when we have a comment describing each "require" line
before is an improvement.  For example, above, it was clear before that the use_gdb_stub
requirement was related to "run".  Afterwards, it is not clear whether the 
support_displaced_stepping check is related to the comment.


>  

> --- a/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
> +++ b/gdb/testsuite/gdb.base/fork-print-inferior-events.exp
> @@ -20,11 +20,9 @@
>  # 'set detach-on-fork [on,off]' are the correct ones.
>  
>  # This test relies on "run", so it cannot run on target remote stubs.
> -require !use_gdb_stub
> -
>  # Test relies on checking follow-fork output. Do not run if gdb debug is
>  # enabled as it will be redirected to the log.
> -require !gdb_debug_enabled
> +require !use_gdb_stub !gdb_debug_enabled
>  

Here similarly.  Having a require line connected to the comment as before
seemed better to me, as it's more localized, it's obvious to which require
expression the comment is refering to.  If we always merge, then I fear that
connection will be lost in some less obvious cases.

> diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
> index aaaa134007b..913203ecfb9 100644
> --- a/gdb/testsuite/gdb.base/solib-display.exp
> +++ b/gdb/testsuite/gdb.base/solib-display.exp
> @@ -28,8 +28,6 @@
>  # (and thus aren't affected by shared library unloading) are not
>  # disabled prematurely.
>  
> -require allow_shlib_tests
> -
>  # This test is currently not supported for stub targets, because it uses the
>  # start command (through gdb_start_cmd).  In theory, it could be changed to
>  # use something else (kill + gdb_run_cmd with a manual breakpoint at main).
> @@ -43,7 +41,7 @@ require allow_shlib_tests
>  # This is because the initial stop is done before the shared libraries are
>  # loaded.
>  
> -require !use_gdb_stub
> +require allow_shlib_tests !use_gdb_stub
>  

Here too.  Etc.

>  # Library file.
>  set libname "solib-display-lib"
> diff --git a/gdb/testsuite/gdb.base/solib-nodir.exp b/gdb/testsuite/gdb.base/solib-nodir.exp
> index dd0724909ad..f5d94798f9d 100644
> --- a/gdb/testsuite/gdb.base/solib-nodir.exp
> +++ b/gdb/testsuite/gdb.base/solib-nodir.exp
> @@ -13,18 +13,16 @@
>  # You should have received a copy of the GNU General Public License
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>  
> -require allow_shlib_tests
> +# We need to be able to influence the target's environment and working
> +# directory.  Can't do that if when we connect the inferior is already
> +# running.
> +require allow_shlib_tests !use_gdb_stub
>  
>  # The testcase assumes the target can access the OBJDIR.
>  if [is_remote target] {
>      return
>  }
>  
> -# We need to be able to influence the target's environment and working
> -# directory.  Can't do that if when we connect the inferior is already
> -# running.
> -require !use_gdb_stub

Ditto.  The connection between "already running" and use_gdb_stub ends up
diluted.

Same for the rest of patch where we have comments for each require.

  reply	other threads:[~2023-01-13 12:49 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  2:59 [PATCH v2 00/79] Rewrite "require" test procedure and use it more often Tom Tromey
2023-01-12  2:59 ` [PATCH v2 01/79] Don't use ensure_gdb_index with require Tom Tromey
2023-01-12  2:59 ` [PATCH v2 02/79] Change 'require' to accept a list of predicates Tom Tromey
2023-01-12  2:59 ` [PATCH v2 03/79] Use unsupported in 'require' Tom Tromey
2023-01-12  2:59 ` [PATCH v2 04/79] Use require supports_reverse Tom Tromey
2023-01-12  2:59 ` [PATCH v2 05/79] Use require supports_process_record Tom Tromey
2023-01-12  2:59 ` [PATCH v2 06/79] Use require dwarf2_support Tom Tromey
2023-01-12  2:59 ` [PATCH v2 07/79] Use require is_x86_like_target Tom Tromey
2023-01-12  2:59 ` [PATCH v2 08/79] Use require skip_cplus_tests Tom Tromey
2023-01-12  3:56   ` Kevin Buettner via Gdb-patches
2023-01-12  2:59 ` [PATCH v2 09/79] Use require skip_shlib_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 10/79] Use require skip_dlmopen_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 11/79] Use require skip_stl_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 12/79] Use require skip_rust_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 13/79] Use require skip_fortran_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 14/79] Use require skip_ada_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 15/79] Use require skip_go_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 16/79] Use require skip_d_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 17/79] Use require skip_ctf_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 18/79] Use require skip_hw_watchpoint_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 19/79] Use require skip_ifunc_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 20/79] Use require skip_aarch64_sve_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 21/79] Use require skip_btrace_pt_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 22/79] Use require skip_btrace_tests Tom Tromey
2023-01-12  2:59 ` [PATCH v2 23/79] Use require skip_avx_* Tom Tromey
2023-01-12  2:59 ` [PATCH v2 24/79] Use require support_displaced_stepping Tom Tromey
2023-01-12  2:59 ` [PATCH v2 25/79] Use require is_aarch64_target Tom Tromey
2023-01-12  2:59 ` [PATCH v2 26/79] Use require is_aarch32_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 27/79] Use require is_amd64_regs_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 28/79] Use require is_elf_target Tom Tromey
2023-01-12  3:00 ` [PATCH v2 29/79] Use require can_single_step_to_signal_handler Tom Tromey
2023-01-12  3:00 ` [PATCH v2 30/79] Use require supports_get_siginfo_type Tom Tromey
2023-01-12  3:00 ` [PATCH v2 31/79] Use require support_go_compile Tom Tromey
2023-01-12  3:00 ` [PATCH v2 32/79] Use require use_gdb_stub Tom Tromey
2023-01-12  3:00 ` [PATCH v2 33/79] Use require can_spawn_for_attach Tom Tromey
2023-01-12  3:00 ` [PATCH v2 34/79] Use require isnative Tom Tromey
2023-01-12  3:00 ` [PATCH v2 35/79] Use require skip_gdbserver_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 36/79] Use require skip_shlib_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 37/79] Use require is_c_compiler_gcc Tom Tromey
2023-01-12  3:00 ` [PATCH v2 38/79] Use require gdb_debug_enabled Tom Tromey
2023-01-12  3:00 ` [PATCH v2 39/79] Use require gdb_skip_xml_test Tom Tromey
2023-01-12  3:00 ` [PATCH v2 40/79] Use require gdb_trace_common_supports_arch Tom Tromey
2023-01-12  3:00 ` [PATCH v2 41/79] Use require skip_perf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 42/79] Use require skip_opencl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 43/79] Use require target_can_use_run_cmd Tom Tromey
2023-01-12  3:00 ` [PATCH v2 44/79] Use require using_fission Tom Tromey
2023-01-12  3:00 ` [PATCH v2 45/79] Use require skip_debuginfod_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 46/79] Use require gnat_runtime_has_debug_info Tom Tromey
2023-01-12  3:00 ` [PATCH v2 47/79] Rewrite skip_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 48/79] Remove mi_skip_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 49/79] Fix latent bug in default_prompt_gdb_start Tom Tromey
2023-01-12  3:00 ` [PATCH v2 50/79] Use "require" for Python tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 51/79] Rename to allow_xml_test Tom Tromey
2023-01-12  3:00 ` [PATCH v2 52/79] Rename to allow_aarch64_sve_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 53/79] Rename to allow_ada_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 54/79] Rename to allow_avx512bf16_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 55/79] Rename to allow_avx512fp16_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 56/79] Rename to allow_btrace_pt_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 57/79] Rename to allow_btrace_tests Tom Tromey
2023-01-12  6:39   ` Metzger, Markus T via Gdb-patches
2023-01-12  3:00 ` [PATCH v2 58/79] Rename to allow_cplus_tests and allow_stl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 59/79] Rename to allow_ctf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 60/79] Rename to allow_debuginfod_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 61/79] Rename to allow_dlmopen_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 62/79] Rename to allow_d_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 63/79] Rename to allow_fortran_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 64/79] Rename to allow_gdbserver_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 65/79] Rename to allow_go_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 66/79] Rename to allow_hw_watchpoint_access_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 67/79] Rename to allow_hw_watchpoint_multi_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 68/79] Rename to allow_hw_watchpoint_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 69/79] Rename to allow_ifunc_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 70/79] Rename to allow_opencl_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 71/79] Rename to allow_perf_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 72/79] Rename to allow_python_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 73/79] Rename to allow_rust_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 74/79] Rename to allow_shlib_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 75/79] Rename to allow_tsx_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 76/79] Rename to allow_hw_breakpoint_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 77/79] Rename to allow_guile_tests Tom Tromey
2023-01-14 16:22   ` Tom de Vries via Gdb-patches
2023-01-14 19:50     ` Tom Tromey
2023-01-12  3:00 ` [PATCH v2 78/79] Rename to allow_tui_tests Tom Tromey
2023-01-12  3:00 ` [PATCH v2 79/79] Consolidate calls to require Tom Tromey
2023-01-13 12:48   ` Pedro Alves [this message]
2023-01-13 14:07     ` Tom Tromey
2023-01-13 14:45       ` Pedro Alves
2023-01-13 19:13         ` Tom Tromey
2023-01-12  4:45 ` [PATCH v2 00/79] Rewrite "require" test procedure and use it more often Kevin Buettner via Gdb-patches
2023-01-13  3:51   ` Tom Tromey
2023-01-13 20:18 ` Tom Tromey

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=2e1baa96-5289-537f-5bb4-f128056f6583@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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