aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2023-11-14 15:00:49 +0100
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2023-11-14 15:03:51 +0100
commitc7be5fa993b26d7d398755cac4fad6f05dc19910 (patch)
treed8a0e68ca6a3ee69298c60a7121b1e68c95eafc3
parent5baaed487bfcee02400cafc7b21a4ef417c65c29 (diff)
downloadgdb-c7be5fa993b26d7d398755cac4fad6f05dc19910.zip
gdb-c7be5fa993b26d7d398755cac4fad6f05dc19910.tar.gz
gdb-c7be5fa993b26d7d398755cac4fad6f05dc19910.tar.bz2
gdb: refactor make-target-delegates.py's ARGTYPES
Refactor the ARGTYPES regular expression in make-target-delegates.py to eliminate '.*' for better control on what is matched. 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'. Approved-By: Pedro Alves <pedro@palves.net>
-rwxr-xr-xgdb/make-target-delegates.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/make-target-delegates.py b/gdb/make-target-delegates.py
index 5bbe7c0..fd5f436 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
+ ")$"
)