From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] gdb: refactor make-target-delegates.py's ARGTYPES
Date: Tue, 14 Nov 2023 10:41:21 +0100 [thread overview]
Message-ID: <fcd59d8fc507387a2e5023a9e06d16c54a6ed2bc.1699953637.git.tankut.baris.aktemur@intel.com> (raw)
In-Reply-To: <b03f96baf03fd61dd4bda47fcd725a07938547a0.1699953637.git.tankut.baris.aktemur@intel.com>
Refactor the ARGTYPES regular expression in make-target-delegates.py
to eliminate '.*' for better control on what is matched. This will be
helpful in the next patch where we recognize default argument values.
Also, simplify the "E" match group, for which the optional SYMBOL
becomes redundant because that case can be matched by the "T" group.
After applying this patch, running './make-target-delegates.py' does not
change anything in 'target-delegates.c'.
---
gdb/make-target-delegates.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py
index 5bbe7c0b930..fd5f436a43d 100755
--- a/gdb/make-target-delegates.py
+++ b/gdb/make-target-delegates.py
@@ -73,17 +73,18 @@ METHOD = re.compile(
+ METHOD_TRAILER
)
+# Space-separated symbols.
+CP_SYMBOLS = CP_SYMBOL + r"(\s+" + CP_SYMBOL + r")*"
+
# Regular expression used to dissect argument types.
ARGTYPES = re.compile(
"^("
+ r"(?P<E>enum\s+"
+ SYMBOL
- + r"\s*)("
- + SYMBOL
- + ")?"
- + r"|(?P<T>.*(enum\s+)?"
- + SYMBOL
- + r".*(\s|\*|&))"
+ + r")"
+ + r"|(?P<T>"
+ + CP_SYMBOLS
+ + r"(\s|\*|&)+)"
+ SYMBOL
+ ")$"
)
--
2.34.1
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2023-11-14 9:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 9:41 [PATCH 1/3] gdb: regenerate target-delegates.c Tankut Baris Aktemur
2023-11-14 9:41 ` Tankut Baris Aktemur [this message]
2023-11-14 13:47 ` [PATCH 2/3] gdb: refactor make-target-delegates.py's ARGTYPES Pedro Alves
2023-11-14 9:41 ` [PATCH 3/3] gdb: handle default argument in make-target-delegates.py Tankut Baris Aktemur
2023-11-14 11:31 ` Pedro Alves
2023-11-14 12:48 ` Aktemur, Tankut Baris
2023-11-14 13:36 ` Pedro Alves
2023-11-14 14:17 ` Tom Tromey
2023-11-16 18:11 ` Aktemur, Tankut Baris
2023-11-17 15:41 ` Tom Tromey
2023-11-14 11:14 ` [PATCH 1/3] gdb: regenerate target-delegates.c Pedro Alves
2023-11-14 14: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=fcd59d8fc507387a2e5023a9e06d16c54a6ed2bc.1699953637.git.tankut.baris.aktemur@intel.com \
--to=tankut.baris.aktemur@intel.com \
--cc=gdb-patches@sourceware.org \
/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).