public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Simon Marchi <simon.marchi@efficios.com>,
	Tom de Vries <tdevries@suse.de>,
	Simon Marchi <simon.marchi@polymtl.ca>,
	John Baldwin <jhb@FreeBSD.org>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 6/6] gdb: don't share aspace/pspace on fork with "detach-on-fork on" and "follow-fork-mode child"
Date: Tue, 28 Sep 2021 20:31:58 +0100	[thread overview]
Message-ID: <190e87c1-2680-eb73-3817-0106c8f34ece@palves.net> (raw)
In-Reply-To: <d7ae1038-4ae2-20cd-b8e7-eb5cf66ab706@efficios.com>

On 2021-09-28 8:12 p.m., Simon Marchi via Gdb-patches wrote:

> 
> So, what do you think of the patch below?  The regexp accepts (1|2) for
> both lines.  If you have a simple way to say "either 1 then 2 or 2 then
> 1" (so that it rejects 1 then 1 or 2 then 2), I would take it, but
> otherwise I think this is sufficient.

There's always plain alternatives.  Something like:

       set any "\[^\r\n\]*"

       set loc1_inf1 "$bpnum\\.1 $any inf 1\r\n$bpnum\\.2 $any inf 1"
       set loc1_inf2 "$bpnum\\.1 $any inf 1\r\n$bpnum\\.2 $any inf 2"

       set loc2_inf1 "$bpnum\\.2 $any inf 1\r\n$bpnum\\.2 $any inf 1"
       set loc2_inf2 "$bpnum\\.2 $any inf 1\r\n$bpnum\\.2 $any inf 2"

       gdb_test "info breakpoints $bpnum" \
 	    "($loc1_inf1\r\n$loc2_inf2|$loc1_inf2\r\n$loc2_inf1)" \
  	    "info breakpoints"

Alternatively, something like:

  	gdb_test_multiple "info breakpoints $bpnum" "info breakpoints" {
	  -wrap -re "$bpnum\\.1 $any inf ($::decimal)\r\n$bpnum\\.2 $any inf ($::decimal)" {
		set inf_a $expect_out(1,string)
		set inf_b $expect_out(2,string)

		gdb_assert {($inf_a == 1 && $inf_b == 2) \
                            || ($inf_a == 2 && $inf_b == 1)} \
			$gdb_test_name
          }
        }

Completely untested, written in email client...

  reply	other threads:[~2021-09-28 19:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 20:53 [PATCH 1/6] gdb.base/foll-fork.exp: remove DUPLICATEs Simon Marchi
2021-09-10 20:53 ` [PATCH 2/6] gdb.base/foll-fork.exp: remove gating based on target triplet Simon Marchi
2021-09-10 20:53 ` [PATCH 3/6] gdb.base/foll-fork.exp: refactor to restart GDB between each portion of the test Simon Marchi
2021-09-10 20:54 ` [PATCH 4/6] gdb.base/foll-fork.exp: rename variables Simon Marchi
2021-09-10 20:54 ` [PATCH 5/6] gdb.base/foll-fork.exp: use foreach_with_prefix to handle prefixes Simon Marchi
2021-09-10 20:54 ` [PATCH 6/6] gdb: don't share aspace/pspace on fork with "detach-on-fork on" and "follow-fork-mode child" Simon Marchi
2021-09-10 23:33   ` John Baldwin
2021-09-11  3:16     ` Simon Marchi
2021-09-11 13:02       ` Simon Marchi
2021-09-11 13:03         ` Simon Marchi
2021-09-27 19:32       ` Simon Marchi
2021-09-28 15:10         ` Tom de Vries
2021-09-28 19:12           ` Simon Marchi
2021-09-28 19:31             ` Pedro Alves [this message]
2021-09-28 19:35               ` Pedro Alves
2021-09-28 23:32                 ` Simon Marchi
2021-09-28 22:38             ` Tom de Vries
2021-09-23 19:23 ` [PATCH 1/6] gdb.base/foll-fork.exp: remove DUPLICATEs Pedro Alves

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=190e87c1-2680-eb73-3817-0106c8f34ece@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=simon.marchi@efficios.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tdevries@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).