Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] fix thinko in pre/post hook help output
@ 2008-08-29 23:56 Doug Evans
  2008-08-30  0:18 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Evans @ 2008-08-29 23:56 UTC (permalink / raw)
  To: gdb-patches

fyi, checked in as obvious (swap before/after).

2008-08-29  Doug Evans  <dje@google.com>

	* cli/cli-decode.c (help_cmd): Fix thinko in pre/post hook help output.

Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.69
diff -u -p -u -p -r1.69 cli-decode.c
--- cli/cli-decode.c	30 Jul 2008 01:10:17 -0000	1.69
+++ cli/cli-decode.c	29 Aug 2008 23:48:28 -0000
@@ -797,12 +797,12 @@ help_cmd (char *command, struct ui_file 
                       "\nThis command has a hook (or hooks) defined:\n");
 
   if (c->hook_pre)
-    fprintf_filtered (stream, 
-                      "\tThis command is run after  : %s (pre hook)\n",
+    fprintf_filtered (stream,
+                      "\tThis command is run before : %s (pre hook)\n",
                     c->hook_pre->name);
   if (c->hook_post)
-    fprintf_filtered (stream, 
-                      "\tThis command is run before : %s (post hook)\n",
+    fprintf_filtered (stream,
+                      "\tThis command is run after  : %s (post hook)\n",
                     c->hook_post->name);
 }
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix thinko in pre/post hook help output
  2008-08-29 23:56 [PATCH] fix thinko in pre/post hook help output Doug Evans
@ 2008-08-30  0:18 ` Pedro Alves
  2008-08-30  1:56   ` Doug Evans
  0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2008-08-30  0:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: Doug Evans

On Saturday 30 August 2008 00:55:47, Doug Evans wrote:
> fyi, checked in as obvious (swap before/after).
>
> 2008-08-29  Doug Evans  <dje@google.com>
>
> 	* cli/cli-decode.c (help_cmd): Fix thinko in pre/post hook help output.
>
> Index: cli/cli-decode.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
> retrieving revision 1.69
> diff -u -p -u -p -r1.69 cli-decode.c
> --- cli/cli-decode.c	30 Jul 2008 01:10:17 -0000	1.69
> +++ cli/cli-decode.c	29 Aug 2008 23:48:28 -0000
> @@ -797,12 +797,12 @@ help_cmd (char *command, struct ui_file
>                        "\nThis command has a hook (or hooks) defined:\n");
>
>    if (c->hook_pre)
> -    fprintf_filtered (stream,
> -                      "\tThis command is run after  : %s (pre hook)\n",
> +    fprintf_filtered (stream,
> +                      "\tThis command is run before : %s (pre hook)\n",
>                      c->hook_pre->name);

I don't think this change is correct.  The command refered to in this
context does run *after* the pre-hook,

>    if (c->hook_post)
> -    fprintf_filtered (stream,
> -                      "\tThis command is run before : %s (post hook)\n",
> +    fprintf_filtered (stream,
> +                      "\tThis command is run after  : %s (post hook)\n",
>                      c->hook_post->name);
>  }

and *before* the post-hook runs.  E.g.,

  (gdb) define hook-thread
  Type commands for definition of "hook-thread".
  End with a line saying just "end".
  >print "before"
  >end
  (gdb) help thread
  ...
  This command has a hook (or hooks) defined:
          This command is run after  : hook-thread (pre hook)
  (gdb) thread
  $1 = "before"
  [Current thread is 1 (Thread 0x7ffff7fd46e0 (LWP 7467))]
  (gdb)

"thread" does runs *after* "hook-thread".

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix thinko in pre/post hook help output
  2008-08-30  0:18 ` Pedro Alves
@ 2008-08-30  1:56   ` Doug Evans
  2008-08-30 15:05     ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Doug Evans @ 2008-08-30  1:56 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On Fri, Aug 29, 2008 at 5:18 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> On Saturday 30 August 2008 00:55:47, Doug Evans wrote:
>> fyi, checked in as obvious (swap before/after).
>>
>> 2008-08-29  Doug Evans  <dje@google.com>
>>
>>       * cli/cli-decode.c (help_cmd): Fix thinko in pre/post hook help output.
>>
>> Index: cli/cli-decode.c
>> ===================================================================
>> RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
>> retrieving revision 1.69
>> diff -u -p -u -p -r1.69 cli-decode.c
>> --- cli/cli-decode.c  30 Jul 2008 01:10:17 -0000      1.69
>> +++ cli/cli-decode.c  29 Aug 2008 23:48:28 -0000
>> @@ -797,12 +797,12 @@ help_cmd (char *command, struct ui_file
>>                        "\nThis command has a hook (or hooks) defined:\n");
>>
>>    if (c->hook_pre)
>> -    fprintf_filtered (stream,
>> -                      "\tThis command is run after  : %s (pre hook)\n",
>> +    fprintf_filtered (stream,
>> +                      "\tThis command is run before : %s (pre hook)\n",
>>                      c->hook_pre->name);
>
> I don't think this change is correct.  The command refered to in this
> context does run *after* the pre-hook,
>
>>    if (c->hook_post)
>> -    fprintf_filtered (stream,
>> -                      "\tThis command is run before : %s (post hook)\n",
>> +    fprintf_filtered (stream,
>> +                      "\tThis command is run after  : %s (post hook)\n",
>>                      c->hook_post->name);
>>  }
>
> and *before* the post-hook runs.  E.g.,
>
>  (gdb) define hook-thread
>  Type commands for definition of "hook-thread".
>  End with a line saying just "end".
>  >print "before"
>  >end
>  (gdb) help thread
>  ...
>  This command has a hook (or hooks) defined:
>          This command is run after  : hook-thread (pre hook)
>  (gdb) thread
>  $1 = "before"
>  [Current thread is 1 (Thread 0x7ffff7fd46e0 (LWP 7467))]
>  (gdb)
>
> "thread" does runs *after* "hook-thread".
>
> --
> Pedro Alves
>

Oh bother.  I guess it can be interpreted that way.  Serves me right
for assuming interpreting English is obvious.
Reverted.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix thinko in pre/post hook help output
  2008-08-30  1:56   ` Doug Evans
@ 2008-08-30 15:05     ` Pedro Alves
  0 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2008-08-30 15:05 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

On Saturday 30 August 2008 02:55:59, Doug Evans wrote:

> Oh bother.  I guess it can be interpreted that way.  Serves me right
> for assuming interpreting English is obvious.
> Reverted.

I'm very sorry, and it serves me right to learn to keep quiet.  :-(   Indeed,
it can be interpreted both ways.  It's the use of "This command"
possibly refering to a different command from the previous sentence
also using "This command", that makes it ambiguous, IMHO; but
the ':' may point out that it is refering to the following command.

How about we close this issue with changing the output to:

  This command has the following hook (or hooks) defined:
          The following command is run before: %s (pre hook)
          The following command is run after : %s (post hook)

?

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-30 15:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-29 23:56 [PATCH] fix thinko in pre/post hook help output Doug Evans
2008-08-30  0:18 ` Pedro Alves
2008-08-30  1:56   ` Doug Evans
2008-08-30 15:05     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox