* [PATCH] Unconditionally use REG_EXTENDED
@ 2020-10-02 16:26 Tom Tromey
2020-10-02 17:18 ` Andrew Burgess
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2020-10-02 16:26 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
skip.c checks whether REG_EXTENDED is defined -- but this should
always be available, and is used unconditionally in other parts of
gdb. This patch removes this check, then further simplifies this
code, removing a declaration and a repeated assertion.
gdb/ChangeLog
2020-10-02 Tom Tromey <tromey@adacore.com>
* skip.c (skiplist_entry::skiplist_entry): Unconditionally use
REG_EXTENDED.
---
gdb/ChangeLog | 5 +++++
gdb/skip.c | 10 ++--------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/gdb/skip.c b/gdb/skip.c
index 419dd7a4682..e6499d619c7 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -139,14 +139,8 @@ skiplist_entry::skiplist_entry (bool file_is_glob,
if (m_function_is_regexp)
{
gdb_assert (!m_function.empty ());
-
- int flags = REG_NOSUB;
-#ifdef REG_EXTENDED
- flags |= REG_EXTENDED;
-#endif
-
- gdb_assert (!m_function.empty ());
- m_compiled_function_regexp.emplace (m_function.c_str (), flags,
+ m_compiled_function_regexp.emplace (m_function.c_str (),
+ REG_NOSUB | REG_EXTENDED,
_("regexp"));
}
}
--
2.26.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Unconditionally use REG_EXTENDED
2020-10-02 16:26 [PATCH] Unconditionally use REG_EXTENDED Tom Tromey
@ 2020-10-02 17:18 ` Andrew Burgess
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2020-10-02 17:18 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
* Tom Tromey <tromey@adacore.com> [2020-10-02 10:26:47 -0600]:
> skip.c checks whether REG_EXTENDED is defined -- but this should
> always be available, and is used unconditionally in other parts of
> gdb. This patch removes this check, then further simplifies this
> code, removing a declaration and a repeated assertion.
>
> gdb/ChangeLog
> 2020-10-02 Tom Tromey <tromey@adacore.com>
>
> * skip.c (skiplist_entry::skiplist_entry): Unconditionally use
> REG_EXTENDED.
LGTM.
Thanks,
Andrew
> ---
> gdb/ChangeLog | 5 +++++
> gdb/skip.c | 10 ++--------
> 2 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/gdb/skip.c b/gdb/skip.c
> index 419dd7a4682..e6499d619c7 100644
> --- a/gdb/skip.c
> +++ b/gdb/skip.c
> @@ -139,14 +139,8 @@ skiplist_entry::skiplist_entry (bool file_is_glob,
> if (m_function_is_regexp)
> {
> gdb_assert (!m_function.empty ());
> -
> - int flags = REG_NOSUB;
> -#ifdef REG_EXTENDED
> - flags |= REG_EXTENDED;
> -#endif
> -
> - gdb_assert (!m_function.empty ());
> - m_compiled_function_regexp.emplace (m_function.c_str (), flags,
> + m_compiled_function_regexp.emplace (m_function.c_str (),
> + REG_NOSUB | REG_EXTENDED,
> _("regexp"));
> }
> }
> --
> 2.26.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-02 17:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-02 16:26 [PATCH] Unconditionally use REG_EXTENDED Tom Tromey
2020-10-02 17:18 ` Andrew Burgess
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).