This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules
- From: "Pierre Muller" <muller at ics dot u-strasbg dot fr>
- To: "'Eli Zaretskii'" <eliz at gnu dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Mon, 20 Apr 2009 18:00:49 +0200
- Subject: [PATCH] gdbadmin/ss/gdb_ari.sh modify editCase/UCASE rules
- References: <007201c9bd4a$e64c9d20$b2e5d760$@u-strasbg.fr> <83bpqyml9s.fsf@gnu.org>
Following Eli's suggestion
I rewrote the editCase/UCASE awk script
to only catch real function implementations.
It seems to only catch real cases, at least for editCase.
The only risk is that it doesn't find function, if the
do not follow the rule of having the open brace at next line.
Pierre Muller
Pascal language support maintainer for GDB
trying to improve the gdb ARI script.
PS: tell me if I am wrong, but I had to use
/complicated pattern/ {
instructions for match
}
! /same complicated pattern/ {
instructions if no match
}
"else" does not seem to accepted at that level in gawk.
Committed patch:
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.88
diff -r1.88 gdb_ari.sh
181a182,183
> possible_UCASE = 0
> possible_editCase = 0
466,468c468,479
< /^[A-Z][[:alnum:]_]*[[:space:]]*\(/ {
< if (is_yacc_or_lex == 0) {
< fail("UCASE function")
---
> /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ {
> possible_UCASE = 1
> possible_FNR = FNR
> }
> ! /^[A-Z][[:alnum:]_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ {
> if (possible_UCASE == 1) {
> if (($0 ~ /^\{/) && (is_yacc_or_lex == 0)) {
> store_FNR = FNR
> FNR = possible_FNR
> fail("UCASE function")
> FNR = store_FNR
> }
469a481
> possible_UCASE = 0
476,478c488,499
< /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\(/ {
< if (is_yacc_or_lex == 0) {
< fail("editCase function")
---
> /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\)[[:space:]]*$/ {
> possible_editCase = 1
> possible_FNR = FNR
> }
> ! /^[a-z][a-z0-9_]*[A-Z][a-z0-9A-Z_]*[[:space:]]*\([^()]*\)[[:space:]]*$/
{
> if (possible_editCase == 1) {
> if (($0 ~ /^\{/) && (is_yacc_or_lex == 0)) {
> store_FNR = FNR
> FNR = possible_FNR
> fail("editCase function")
> FNR = store_FNR
> }
479a501
> possible_editCase = 0