From: John Baldwin <jhb@FreeBSD.org>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb tests: Allow for "LWP" in thread IDs from info threads.
Date: Tue, 18 Apr 2023 13:14:10 -0700 [thread overview]
Message-ID: <30577be3-13ea-8fea-5702-a6fea38bd1e0@FreeBSD.org> (raw)
In-Reply-To: <87h6tetg1l.fsf@tromey.com>
On 4/17/23 1:22 PM, Tom Tromey wrote:
>>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:
>
>>> - {.*[\r\n]+\* +([0-9]+) +Thread[^\r\n]* do_something \(n=\1\) at.*}
>>> + {.*[\r\n]+\* +([0-9]+) +${tdlabel_re}[^\r\n]* do_something \(n=\1\) at.*}
>>> # Check for expected results when passing a valid thread handle
>>> to
>>> # thread_from_handle().
>
> John> This one fails because the variable isn't expanded. If I change the {}'s to
> John> quotes then the test fails. If I inline the value of `tdlabel_re` here, the
> John> test passes. I'm just not sure how to use a variable in a {} expression.
>
> {} prevent substitutions.
>
> One way to do this is to use "" but then you may need extra backslashes.
>
> Another way is format:
>
> [format {... %s ... } $tdlabel_re]
>
> Yet another way is subst:
>
> [subst -nobackslashes -nocommands {...the above...}]
Thanks for the pointers. I went with the second approach in the V3 patch.
--
John Baldwin
prev parent reply other threads:[~2023-04-18 20:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 17:01 John Baldwin
2023-04-17 17:25 ` John Baldwin
2023-04-17 20:22 ` Tom Tromey
2023-04-18 20:14 ` John Baldwin [this message]
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=30577be3-13ea-8fea-5702-a6fea38bd1e0@FreeBSD.org \
--to=jhb@freebsd.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).