Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Add extern of output_command to utils.h
@ 2012-12-20 12:21 Hui Zhu
  2013-01-03 21:41 ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2012-12-20 12:21 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches ml

Hi Tom,

According to you comments for target ctf patch, I make a patch to add
extern of output_command to utils.h.
Please help me review it.

Thanks,
Hui

2012-12-20  Hui Zhu  <hui_zhu@mentor.com>

	* tracepoint.c: Remove extern of function output_command.
	* utils.h (output_command): New extern.

--- a/tracepoint.c
+++ b/tracepoint.c
@@ -93,11 +93,6 @@ extern void (*deprecated_readline_begin_
 extern char *(*deprecated_readline_hook) (char *);
 extern void (*deprecated_readline_end_hook) (void);

-/* GDB commands implemented in other modules:
- */
-
-extern void output_command (char *, int);
-
 /*
    Tracepoint.c:

--- a/utils.h
+++ b/utils.h
@@ -378,4 +378,6 @@ extern int myread (int, char *, int);
 extern ULONGEST align_up (ULONGEST v, int n);
 extern ULONGEST align_down (ULONGEST v, int n);

+extern void output_command (char *, int);
+
 #endif /* UTILS_H */


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

* Re: [PATCH] Add extern of output_command to utils.h
  2012-12-20 12:21 [PATCH] Add extern of output_command to utils.h Hui Zhu
@ 2013-01-03 21:41 ` Tom Tromey
  2013-01-04  9:04   ` Hui Zhu
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2013-01-03 21:41 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches ml

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> 	* tracepoint.c: Remove extern of function output_command.
Hui> 	* utils.h (output_command): New extern.

I appreciate you doing this, but utils.h seems like a weird place to put
this.

I don't know of a better place but I suppose if I were doing it, I would
look for a header that, ideally, is both printing-related and already
has some _command declarations in it.

Tom


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-03 21:41 ` Tom Tromey
@ 2013-01-04  9:04   ` Hui Zhu
  2013-01-04 14:45     ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2013-01-04  9:04 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches ml

On Fri, Jan 4, 2013 at 5:41 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui>    * tracepoint.c: Remove extern of function output_command.
> Hui>    * utils.h (output_command): New extern.
>
> I appreciate you doing this, but utils.h seems like a weird place to put
> this.
>
> I don't know of a better place but I suppose if I were doing it, I would
> look for a header that, ideally, is both printing-related and already
> has some _command declarations in it.
>
> Tom

Hi Tom,

What about add this extern to valprint.h that is included by printcmd.c?

Thanks,
Hui


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-04  9:04   ` Hui Zhu
@ 2013-01-04 14:45     ` Tom Tromey
  2013-01-05  5:37       ` Hui Zhu
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2013-01-04 14:45 UTC (permalink / raw)
  To: Hui Zhu; +Cc: gdb-patches ml

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> What about add this extern to valprint.h that is included by printcmd.c?

That sounds ok to me.

Tom


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-04 14:45     ` Tom Tromey
@ 2013-01-05  5:37       ` Hui Zhu
  2013-01-06  6:50         ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2013-01-05  5:37 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches ml

On Fri, Jan 4, 2013 at 10:45 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui> What about add this extern to valprint.h that is included by printcmd.c?
>
> That sounds ok to me.
>
> Tom

Post a new version according to that.  Please help me review it.

Thanks,
Hui

2013-01-05  Hui Zhu  <hui_zhu@mentor.com>

	* tracepoint.c: Remove extern of function output_command.
	* valprint.h.h (output_command): New extern.

--- a/tracepoint.c
+++ b/tracepoint.c
@@ -93,11 +93,6 @@ extern void (*deprecated_readline_begin_
 extern char *(*deprecated_readline_hook) (char *);
 extern void (*deprecated_readline_end_hook) (void);

-/* GDB commands implemented in other modules:
- */
-
-extern void output_command (char *, int);
-
 /*
    Tracepoint.c:

--- a/valprint.h
+++ b/valprint.h
@@ -205,4 +205,6 @@ extern void generic_printstr (struct ui_
 			      int quote_char, int c_style_terminator,
 			      const struct value_print_options *options);

+extern void output_command (char *, int);
+
 #endif


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-05  5:37       ` Hui Zhu
@ 2013-01-06  6:50         ` Joel Brobecker
  2013-01-06  7:33           ` Hui Zhu
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2013-01-06  6:50 UTC (permalink / raw)
  To: Hui Zhu; +Cc: Tom Tromey, gdb-patches ml

> 2013-01-05  Hui Zhu  <hui_zhu@mentor.com>
> 
> 	* tracepoint.c: Remove extern of function output_command.
> 	* valprint.h.h (output_command): New extern.

If I may, can we try to provide the names of the arguments
in function declarations?

> --- a/valprint.h
> +++ b/valprint.h
> @@ -205,4 +205,6 @@ extern void generic_printstr (struct ui_
>  			      int quote_char, int c_style_terminator,
>  			      const struct value_print_options *options);
> 
> +extern void output_command (char *, int);
> +

Thanks,
-- 
Joel


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-06  6:50         ` Joel Brobecker
@ 2013-01-06  7:33           ` Hui Zhu
  2013-01-07 15:08             ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2013-01-06  7:33 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Tom Tromey, gdb-patches ml

On Sun, Jan 6, 2013 at 2:50 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> 2013-01-05  Hui Zhu  <hui_zhu@mentor.com>
>>
>>       * tracepoint.c: Remove extern of function output_command.
>>       * valprint.h.h (output_command): New extern.
>
> If I may, can we try to provide the names of the arguments
> in function declarations?
>
>> --- a/valprint.h
>> +++ b/valprint.h
>> @@ -205,4 +205,6 @@ extern void generic_printstr (struct ui_
>>                             int quote_char, int c_style_terminator,
>>                             const struct value_print_options *options);
>>
>> +extern void output_command (char *, int);
>> +
>
> Thanks,
> --
> Joel

OK.  I post a new version according to your comments.

Thanks,
Hui

2013-01-05  Hui Zhu  <hui_zhu@mentor.com>

	* printcmd.c: Remove define of function output_command.
	* tracepoint.c: Remove extern of function output_command.
	* valprint.h.h (output_command): New extern.

--- a/printcmd.c
+++ b/printcmd.c
@@ -172,8 +172,6 @@ static int display_number;

 /* Prototypes for exported functions.  */

-void output_command (char *, int);
-
 void _initialize_printcmd (void);

 /* Prototypes for local functions.  */
--- a/tracepoint.c
+++ b/tracepoint.c
@@ -93,11 +93,6 @@ extern void (*deprecated_readline_begin_
 extern char *(*deprecated_readline_hook) (char *);
 extern void (*deprecated_readline_end_hook) (void);

-/* GDB commands implemented in other modules:
- */
-
-extern void output_command (char *, int);
-
 /*
    Tracepoint.c:

--- a/valprint.h
+++ b/valprint.h
@@ -205,4 +205,6 @@ extern void generic_printstr (struct ui_
 			      int quote_char, int c_style_terminator,
 			      const struct value_print_options *options);

+extern void output_command (char *exp, int from_tty);
+
 #endif


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

* Re: [PATCH] Add extern of output_command to utils.h
  2013-01-06  7:33           ` Hui Zhu
@ 2013-01-07 15:08             ` Tom Tromey
  2013-01-07 15:12               ` Pierre Muller
       [not found]               ` <50eae5d4.e606c20a.75af.fffffc7eSMTPIN_ADDED_BROKEN@mx.google.com>
  0 siblings, 2 replies; 10+ messages in thread
From: Tom Tromey @ 2013-01-07 15:08 UTC (permalink / raw)
  To: Hui Zhu; +Cc: Joel Brobecker, gdb-patches ml

>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:

Hui> 2013-01-05  Hui Zhu  <hui_zhu@mentor.com>

Hui> 	* printcmd.c: Remove define of function output_command.
Hui> 	* tracepoint.c: Remove extern of function output_command.
Hui> 	* valprint.h.h (output_command): New extern.

This is ok.  Thanks.

Tom


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

* RE: [PATCH] Add extern of output_command to utils.h
  2013-01-07 15:08             ` Tom Tromey
@ 2013-01-07 15:12               ` Pierre Muller
       [not found]               ` <50eae5d4.e606c20a.75af.fffffc7eSMTPIN_ADDED_BROKEN@mx.google.com>
  1 sibling, 0 replies; 10+ messages in thread
From: Pierre Muller @ 2013-01-07 15:12 UTC (permalink / raw)
  To: 'Tom Tromey', 'Hui Zhu'
  Cc: 'Joel Brobecker', 'gdb-patches ml'



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : lundi 7 janvier 2013 16:09
> À : Hui Zhu
> Cc : Joel Brobecker; gdb-patches ml
> Objet : Re: [PATCH] Add extern of output_command to utils.h
> 
> >>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
> 
> Hui> 2013-01-05  Hui Zhu  <hui_zhu@mentor.com>
> 
> Hui> 	* printcmd.c: Remove define of function output_command.
> Hui> 	* tracepoint.c: Remove extern of function output_command.
> Hui> 	* valprint.h.h (output_command): New extern.

  Just don't forget to remove the secondf ".h", correct line should be:

 	* valprint.h (output_command): New extern.
> This is ok.  Thanks.
> 
> Tom


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

* Re: [PATCH] Add extern of output_command to utils.h
       [not found]               ` <50eae5d4.e606c20a.75af.fffffc7eSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2013-01-08  2:02                 ` Hui Zhu
  0 siblings, 0 replies; 10+ messages in thread
From: Hui Zhu @ 2013-01-08  2:02 UTC (permalink / raw)
  To: Pierre Muller, Tom Tromey; +Cc: Joel Brobecker, gdb-patches ml

On Mon, Jan 7, 2013 at 11:12 PM, Pierre Muller
<pierre.muller@ics-cnrs.unistra.fr> wrote:
>
>
>> -----Message d'origine-----
>> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
>> owner@sourceware.org] De la part de Tom Tromey
>> Envoyé : lundi 7 janvier 2013 16:09
>> À : Hui Zhu
>> Cc : Joel Brobecker; gdb-patches ml
>> Objet : Re: [PATCH] Add extern of output_command to utils.h
>>
>> >>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>>
>> Hui> 2013-01-05  Hui Zhu  <hui_zhu@mentor.com>
>>
>> Hui>  * printcmd.c: Remove define of function output_command.
>> Hui>  * tracepoint.c: Remove extern of function output_command.
>> Hui>  * valprint.h.h (output_command): New extern.
>
>   Just don't forget to remove the secondf ".h", correct line should be:

Thanks for your remind.  Fixed.

>
>         * valprint.h (output_command): New extern.
>> This is ok.  Thanks.
>>
>> Tom
>

Checked in.
http://sourceware.org/ml/gdb-cvs/2013-01/msg00042.html

Best,
Hui


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

end of thread, other threads:[~2013-01-08  2:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 12:21 [PATCH] Add extern of output_command to utils.h Hui Zhu
2013-01-03 21:41 ` Tom Tromey
2013-01-04  9:04   ` Hui Zhu
2013-01-04 14:45     ` Tom Tromey
2013-01-05  5:37       ` Hui Zhu
2013-01-06  6:50         ` Joel Brobecker
2013-01-06  7:33           ` Hui Zhu
2013-01-07 15:08             ` Tom Tromey
2013-01-07 15:12               ` Pierre Muller
     [not found]               ` <50eae5d4.e606c20a.75af.fffffc7eSMTPIN_ADDED_BROKEN@mx.google.com>
2013-01-08  2:02                 ` Hui Zhu

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