|
From: <ar...@de...> - 2003-11-17 17:00:14
|
Hi all. I'm interested in showing the valgrind --help output to STDOUT instead of STDERR to pipe it to a pager or something. Can anybody tell me what do I need to change? I used to use an ugly hack of dup2() calls but I think there is a better (and prettier) way to do that. Thanks in advance. -- Andres Roldan Fluidsignal Group <ar...@fl...> The Debian Project <ar...@de...> GIGAX <ar...@gi...> GPG Key-ID 0xB29396EB Home Page http://people.fluidsignal.com/~aroldan |
|
From: Nicholas N. <nj...@ca...> - 2003-11-17 17:24:54
|
On Mon, 17 Nov 2003, Andr=E9s Rold=E1n wrote: > I'm interested in showing the valgrind --help output to STDOUT > instead of STDERR to pipe it to a pager or something. Can anybody > tell me what do I need to change? > > I used to use an ugly hack of dup2() calls but I think there is > a better (and prettier) way to do that. valgrind --help 2>&1 | more N |
|
From: <ar...@de...> - 2003-11-17 17:27:45
|
Nicholas Nethercote <nj...@ca...> writes: > On Mon, 17 Nov 2003, Andrés Roldán wrote: > >> I'm interested in showing the valgrind --help output to STDOUT >> instead of STDERR to pipe it to a pager or something. Can anybody >> tell me what do I need to change? >> >> I used to use an ugly hack of dup2() calls but I think there is >> a better (and prettier) way to do that. > > valgrind --help 2>&1 | more I know. I'm maintaining valgrind for Debian and there is a rule on Debian that says that every large --help message should be on STDOUT instead of STDERR. I'm not asking to include this feature to the main valgring source :) Thanks. > > N -- Andres Roldan Fluidsignal Group <ar...@fl...> The Debian Project <ar...@de...> GIGAX <ar...@gi...> GPG Key-ID 0xB29396EB Home Page http://people.fluidsignal.com/~aroldan |
|
From: Nicholas N. <nj...@ca...> - 2003-11-17 17:46:19
|
On Mon, 17 Nov 2003, Andr=E9s Rold=E1n wrote:
> > valgrind --help 2>&1 | more
>
> I know. I'm maintaining valgrind for Debian and there is a rule on
> Debian that says that every large --help message should be on STDOUT
> instead of STDERR.
Oh, right, sorry.
Try the patch below; I've tested it minimally.
N
RCS file: /home/kde/valgrind/coregrind/vg_main.c,v
retrieving revision 1.115
diff -u -3 -p -r1.115 vg_main.c
--- coregrind/vg_main.c 29 Sep 2003 10:56:24 -0000 1.115
+++ coregrind/vg_main.c 17 Nov 2003 17:44:48 -0000
@@ -527,7 +527,7 @@ Bool VG_(clo_trace_children) =3D False;
/* See big comment in vg_include.h for meaning of these three. */
VgLogTo VG_(clo_log_to) =3D VgLogTo_Fd;
-Int VG_(clo_logfile_fd) =3D 2;
+Int VG_(clo_logfile_fd) =3D 1;
Char* VG_(clo_logfile_name) =3D NULL;
Int VG_(clo_input_fd) =3D 0; /* stdin */
@@ -725,7 +725,7 @@ static void process_cmd_line_options ( v
# define ISSPACE(cc) ((cc) =3D=3D ' ' || (cc) =3D=3D '\t' || (cc) =
=3D=3D '\n')
- eventually_logfile_fd =3D VG_(clo_logfile_fd);
+ eventually_logfile_fd =3D 2;
/* Once logging is started, we can safely send messages pertaining
to failures in initialisation. */
@@ -1102,7 +1102,7 @@ static void process_cmd_line_options ( v
/* So far we should be still attached to stderr, so we can show on
the terminal any problems to do with processing command line
opts. */
- vg_assert(VG_(clo_logfile_fd) =3D=3D 2 /* stderr */);
+ vg_assert(VG_(clo_logfile_fd) =3D=3D 1 /* stderr */);
vg_assert(VG_(logging_to_filedes) =3D=3D True);
switch (VG_(clo_log_to)) {
|
|
From: <ar...@de...> - 2003-11-17 18:37:51
|
Worked fine. Thanks :)
Nicholas Nethercote <nj...@ca...> writes:
> On Mon, 17 Nov 2003, Andrés Roldán wrote:
>
>> > valgrind --help 2>&1 | more
>>
>> I know. I'm maintaining valgrind for Debian and there is a rule on
>> Debian that says that every large --help message should be on STDOUT
>> instead of STDERR.
>
> Oh, right, sorry.
>
> Try the patch below; I've tested it minimally.
>
> N
>
>
>
> RCS file: /home/kde/valgrind/coregrind/vg_main.c,v
> retrieving revision 1.115
> diff -u -3 -p -r1.115 vg_main.c
> --- coregrind/vg_main.c 29 Sep 2003 10:56:24 -0000 1.115
> +++ coregrind/vg_main.c 17 Nov 2003 17:44:48 -0000
> @@ -527,7 +527,7 @@ Bool VG_(clo_trace_children) = False;
>
> /* See big comment in vg_include.h for meaning of these three. */
> VgLogTo VG_(clo_log_to) = VgLogTo_Fd;
> -Int VG_(clo_logfile_fd) = 2;
> +Int VG_(clo_logfile_fd) = 1;
> Char* VG_(clo_logfile_name) = NULL;
>
> Int VG_(clo_input_fd) = 0; /* stdin */
> @@ -725,7 +725,7 @@ static void process_cmd_line_options ( v
>
> # define ISSPACE(cc) ((cc) == ' ' || (cc) == '\t' || (cc) == '\n')
>
> - eventually_logfile_fd = VG_(clo_logfile_fd);
> + eventually_logfile_fd = 2;
>
> /* Once logging is started, we can safely send messages pertaining
> to failures in initialisation. */
> @@ -1102,7 +1102,7 @@ static void process_cmd_line_options ( v
> /* So far we should be still attached to stderr, so we can show on
> the terminal any problems to do with processing command line
> opts. */
> - vg_assert(VG_(clo_logfile_fd) == 2 /* stderr */);
> + vg_assert(VG_(clo_logfile_fd) == 1 /* stderr */);
> vg_assert(VG_(logging_to_filedes) == True);
>
> switch (VG_(clo_log_to)) {
>
>
>
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
--
Andres Roldan
Fluidsignal Group <ar...@fl...>
The Debian Project <ar...@de...>
GIGAX <ar...@gi...>
GPG Key-ID 0xB29396EB
Home Page http://people.fluidsignal.com/~aroldan
|
|
From: Jim M. <ji...@me...> - 2003-11-17 19:08:56
|
Nicholas Nethercote <nj...@ca...> wrote:
...
> @@ -1102,7 +1102,7 @@ static void process_cmd_line_options ( v
> /* So far we should be still attached to stderr, so we can show on
> the terminal any problems to do with processing command line
> opts. */
> - vg_assert(VG_(clo_logfile_fd) == 2 /* stderr */);
> + vg_assert(VG_(clo_logfile_fd) == 1 /* stderr */);
> vg_assert(VG_(logging_to_filedes) == True);
>
> switch (VG_(clo_log_to)) {
You probably already know, and simply prefer to use the hard-coded
literal file numbers, but just in case, ...
it'd make the code a tiny bit more readable to use
STDOUT_FILENO and STDERR_FILENO in place of 1 and 2 respectively.
Then you could get rid of the `/* stderr */' comment that should
(with the above change) read `/* stdout */'.
|
|
From: Dirk M. <dm...@gm...> - 2003-11-18 01:40:02
|
On Monday 17 November 2003 18:45, Nicholas Nethercote wrote: > Try the patch below; I've tested it minimally. IMHO we should commit this to CVS. |
|
From: Olly B. <ol...@su...> - 2003-11-17 17:57:20
|
On Mon, Nov 17, 2003 at 12:41:25PM -0500, Andr?s Rold?n wrote:
> I'm maintaining valgrind for Debian and there is a rule on
> Debian that says that every large --help message should be on STDOUT
> instead of STDERR.
It's a sensible rule, and most Linux programs do send help output to
stdout rather than stderr so valgrind is out of line with convention
here. Perhaps valgrind should by change to use stdout?
Cheers,
Olly
|
|
From: Nicholas N. <nj...@ca...> - 2003-11-20 10:39:09
|
On Mon, 17 Nov 2003, Olly Betts wrote: > > I'm maintaining valgrind for Debian and there is a rule on > > Debian that says that every large --help message should be on STDOUT > > instead of STDERR. > > It's a sensible rule, and most Linux programs do send help output to > stdout rather than stderr so valgrind is out of line with convention > here. Perhaps valgrind should by change to use stdout? Committed to HEAD. Thanks. N |