From c7be5fa993b26d7d398755cac4fad6f05dc19910 Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Tue, 14 Nov 2023 15:00:49 +0100 Subject: [PATCH] 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 --- 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"(?Penum\s+" + SYMBOL - + r"\s*)(" - + SYMBOL - + ")?" - + r"|(?P.*(enum\s+)?" - + SYMBOL - + r".*(\s|\*|&))" + + r")" + + r"|(?P" + + CP_SYMBOLS + + r"(\s|\*|&)+)" + SYMBOL + ")$" ) -- 2.30.2