* [PING] [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON
@ 2010-05-20 21:13 Pierre Muller
0 siblings, 0 replies; 4+ messages in thread
From: Pierre Muller @ 2010-05-20 21:13 UTC (permalink / raw)
To: gdb-patches
Noone reacted to that proposal yet...
Pierre
as ARI maintainer.
-----Message d'origine-----
De : gdb-patches-owner@sourceware.org
[mailto:gdb-patches-owner@sourceware.org] De la part de Pierre Muller
Envoyé : Monday, May 10, 2010 11:01 AM
À : gdb-patches@sourceware.org
Objet : [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON
This patch to ss/gdb_ari.sh
would allow to turn off a specific rule
for a given file until it is, optionally turned on again.
I had this idea after the discussion about editCase function rule,
for which it appeared that adding /*ARI: editCase function */
inside each declaration using mixed case was too
disturbing.
We this new patch, we can disable all 8 warnings of windows-nat.c
by adding just two lines:
/* ARI_OFF: editCase function */
and
/* ARI_ON: editCase function */
at the start and the end of the list of
bad_MixedFunctionNameSameAsWindowsAPI
list.
Comments?
Pierre Muller
Pascal language support maintainer for GDB
as ARI maintainer.
$ cvs diff -u -p gdb_ari.sh
Index: gdb_ari.sh
===================================================================
RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v
retrieving revision 1.104
diff -u -p -r1.104 gdb_ari.sh
--- gdb_ari.sh 4 May 2010 23:20:37 -0000 1.104
+++ gdb_ari.sh 10 May 2010 08:53:32 -0000
@@ -154,7 +154,7 @@ function fail(bug,supplement) {
exit
}
- if (ARI_OK == bug) {
+ if ((ARI_OK == bug) ||(bug in ari_off)) {
return
}
# Trim the filename down to just DIRECTORY/FILE so that it can be
@@ -217,6 +217,7 @@ END {
BEGIN {
ARI_OK = ""
+ delete ari_off
}
/\/\* ARI:[[:space:]]*(.*)[[:space:]]*\*\// {
@@ -228,6 +229,20 @@ BEGIN {
ARI_OK = ""
}
+/\/\* ARI_OFF:[[:space:]]*(.*)[[:space:]]*\*\// {
+ off_bug = gensub(/^.*\/\*
ARI_OFF:[[:space:]]*(.*[^[:space:]])[[:space:]]*\*\/.*$/, "\\1", 1, $0)
+ # print "ARI_OFF \"" off_bug "\""
+ ari_off[off_bug] = 1
+}
+
+/\/\* ARI_ON:[[:space:]]*(.*)[[:space:]]*\*\// {
+ on_bug = gensub(/^.*\/\*
ARI_ON:[[:space:]]*(.*[^[:space:]])[[:space:]]*\*\/.*$/, "\\1", 1, $0)
+ # print "ARI_ON \"" on_bug "\""
+ if (on_bug in ari_off) {
+ delete ari_off[on_bug]
+ }
+}
+
# Things in comments
Example of ARI editCase fix for windows-nat.c
Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.208
diff -u -p -r1.208 windows-nat.c
--- windows-nat.c 16 Apr 2010 07:49:35 -0000 1.208
+++ windows-nat.c 10 May 2010 09:00:00 -0000
@@ -2522,7 +2522,8 @@ _initialize_check_for_gdb_ini (void)
}
/* Define dummy functions which always return error for the rare cases
where
- these functions could not be found. */
+ these functions could not be found. */
+/* ARI_OFF: editCase function */
static BOOL WINAPI
bad_DebugActiveProcessStop (DWORD w)
{
@@ -2569,6 +2570,7 @@ bad_OpenProcessToken (HANDLE w, DWORD x,
{
return FALSE;
}
+/* ARI_ON: editCase function */
/* Load any functions which may not be available in ancient versions
of Windows. */
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <10524.3587088355$1274389681@news.gmane.org>]
* Re: [PING] [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON
[not found] <10524.3587088355$1274389681@news.gmane.org>
@ 2010-05-21 16:22 ` Tom Tromey
2010-05-21 16:25 ` Pierre Muller
[not found] ` <37953.9021793336$1274458961@news.gmane.org>
0 siblings, 2 replies; 4+ messages in thread
From: Tom Tromey @ 2010-05-21 16:22 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> Noone reacted to that proposal yet...
Sorry about that.
Pierre> We this new patch, we can disable all 8 warnings of windows-nat.c
Pierre> by adding just two lines:
Pierre> /* ARI_OFF: editCase function */
Pierre> and
Pierre> /* ARI_ON: editCase function */
Pierre> at the start and the end of the list of
Pierre> bad_MixedFunctionNameSameAsWindowsAPI
Pierre> list.
Pierre> Comments?
I think this kind of mechanism is too obscure. The markers may be very
far from the place that one is editing.
Do we really need this particular ARI rule at all? This sort of problem
is usually caught by patch review... and if it an instance is missed, it
doesn't have any impact on code quality.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [PING] [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON
2010-05-21 16:22 ` Tom Tromey
@ 2010-05-21 16:25 ` Pierre Muller
[not found] ` <37953.9021793336$1274458961@news.gmane.org>
1 sibling, 0 replies; 4+ messages in thread
From: Pierre Muller @ 2010-05-21 16:25 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
> I think this kind of mechanism is too obscure. The markers may be very
> far from the place that one is editing.
>
> Do we really need this particular ARI rule at all? This sort of
> problem
> is usually caught by patch review... and if it an instance is missed,
> it
> doesn't have any impact on code quality.
OK, I get your point, and you are not the first
one taking that position.
Let's drop this also,
proposal officially withdrawn.
I will try to work further on more
ARI if I find time... but will try to focus on
more essential points.
Pierre
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <37953.9021793336$1274458961@news.gmane.org>]
* Re: [PING] [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON
[not found] ` <37953.9021793336$1274458961@news.gmane.org>
@ 2010-05-21 16:52 ` Tom Tromey
0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2010-05-21 16:52 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> I will try to work further on more
Pierre> ARI if I find time... but will try to focus on
Pierre> more essential points.
One thing I've been wanting to do for quite a while is get
treehydra-for-C running, then write some scripts to check various
possibly buggy things in gdb.
This approach is more difficult but it also opens up many possibilities
that, I think, are not easily done with awk.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-21 16:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-20 21:13 [PING] [RFC] Extend gdb_ari.sh with ARI_OFF/ARI_ON Pierre Muller
[not found] <10524.3587088355$1274389681@news.gmane.org>
2010-05-21 16:22 ` Tom Tromey
2010-05-21 16:25 ` Pierre Muller
[not found] ` <37953.9021793336$1274458961@news.gmane.org>
2010-05-21 16:52 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox