From: tdevries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/build] Hardcode --with-included-regex
Date: Mon, 19 Apr 2021 22:33:07 +0200 [thread overview]
Message-ID: <77a676bcd18e5603a4597fee89dc4269@suse.de> (raw)
In-Reply-To: <87k0oycazs.fsf@tromey.com>
On 2021-04-19 21:47, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> A note on the latter: it's actually a bug to compile a regex
> using regcomp and
> Tom> then pass it to re_search. The GNU regex interface requires one
> to use
> Tom> re_compile_pattern or re_compile_fastmap. But as long we're
> using one of the
> Tom> GNU regex incarnations in gnulib, glibc or libiberty, we get away
> with this.
>
> Tom> The PR could be fixed by adding -lc in a specific position in the
> link line,
> Tom> to force regcomp to be bound to glibc. But this solution was
> considered
> Tom> in the discussion in the PR as being brittle, and possibly causing
> problems
> Tom> elsewhere.
>
> Tom> Another solution offered was to restrict regex usage to posix,
> and no longer
> Tom> use the GNU regex API. This however could mean having to
> reproduce some of
> Tom> that functionality locally, which would mean maintaining the same
> Tom> functionality in more than one place.
>
> Just to be clear, using the GNU extensions isn't currently done, I
> think.
In gdb_regex.{c,h}, we have compiled_regex::search, which uses GNU regex
function re_search. The functionality is actually used, removing it
breaks the gdb build.
So I don't quite understand your remark.
Thanks,
- Tom
> I'd like to use them so GDB can avoid copying some strings to
> ensure they are \0-terminated; but this isn't done at the moment.
>
> So, it would also be equivalent, right now, to switch GDB to conform to
> POSIX here.
>
> Personally I'm fine with just requiring the libiberty regexp.
> That said we should probably see if there are differing opinions, or
> some reason to keep the flag.
>
> thanks,
> Tom
next prev parent reply other threads:[~2021-04-19 20:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 15:34 Tom de Vries
2021-04-19 19:47 ` Tom Tromey
2021-04-19 20:33 ` tdevries [this message]
2021-04-21 16:59 ` 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=77a676bcd18e5603a4597fee89dc4269@suse.de \
--to=tdevries@suse.de \
--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