From: Eli Zaretskii <eliz@gnu.org>
To: Hui Zhu <teawater@gmail.com>
Cc: gdb-patches@sourceware.org, msnyder@vmware.com
Subject: Re: [RFA/RFC] Add dump and load command to process record and replay
Date: Sat, 01 Aug 2009 09:57:00 -0000 [thread overview]
Message-ID: <83my6jq2k3.fsf@gnu.org> (raw)
In-Reply-To: <daef60380908010030o1189baaal3927a286e069971c@mail.gmail.com>
> From: Hui Zhu <teawater@gmail.com>
> Date: Sat, 1 Aug 2009 15:30:38 +0800
> Cc: Michael Snyder <msnyder@vmware.com>, Eli Zaretskii <eliz@gnu.org>
>
> This patch add command record dump and record load to make prec can
> dump execution log to a file and load it later. And load can work
> with core file.
Thanks.
> + /* Default corefile name is "rec.PID". */
I suggest the default name to be "gdb_record.PID".
> + if (write (recfd, &magic, 4) != 4)
> + error (_("Failed to write '%s' for dump."), recfilename);
I suggest to change the text (here and elsewhere in your patch) to:
"Failed to write dump of execution records to `%s'."
I also suggest to replace the numerous fragments like this:
> + if (write (recfd, &tmpu8, 1) != 1)
> + error (_("Failed to write '%s' for dump."), recfilename);
with calls to a function which tries to write and errors out of it
cannot. That would leave only one "Failed to write ..." string,
instead of having gobs of them.
> + fprintf_filtered (gdb_stdout, "Saved recfile %s.\n", recfilename);
I suggest to replace the message text with this:
"Saved dump of execution records to `%s'."
> + if (recfd < 0)
> + error (_("Failed to open '%s' for load."), args);
A better text would be
"Failed to open `%s' for loading execution records: %s"
The second %s should get the result of strerror (errno), to describe
the reason of the failure
> + if (read (recfd, &magic, 4) != 4)
> + error (_("Failed to read '%s' for load."), args);
"Failed reading dump of execution records in `%s'"
Again, I suggest to have a single function that reads and errors out
on error.
> + if (magic != RECORD_FILE_MAGIC)
> + error (_("'%s' is not a record dump."), args);
"`%s' is not a valid dump of execution records."
> + c = add_cmd ("dump", class_obscure, cmd_record_dump,
> + _("Dump the execution log to a file.\n\
"Dump the execution records to a file."
> +Argument is optional filename. Default filename is 'rec.<process_id>'."),
> + &record_cmdlist);
> + set_cmd_completer (c, filename_completer);
> + c = add_cmd ("load", class_obscure, cmd_record_load,
> + _("Load the execution log from a file. Argument is filename."),
"Load previously dumped execution records from a file given as argument."
Note that you cannot have more than one period on the first line,
because the help commands assume there's only one there.
> +@kindex record dump
> +@kindex rec dump
> +@item record dump [@var{file}]
> +@itemx rec dump [@var{file}]
> +Produce a record execution log of the inferior process. The optional
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dump the execution records of the inferior process to a file.
> +argument @var{file} specifies the file name where to put the record dump.
> +If not specified, the file name defaults to @file{rec.@var{pid}}, where
> +@var{pid} is the inferior process ID.
^^^^^^^^^^^^^^^^^^^^^^^^^^
"is the PID of the inferior process."
> +Load process record execution log from @var{file}.
Load previously-dumped execution records from @var{file}.
> +It can work with @code{core-file}.
This needs further explanation. Or maybe just delete it, if it
silently does The Right Thing.
next prev parent reply other threads:[~2009-08-01 9:57 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-01 7:31 Hui Zhu
2009-08-01 9:57 ` Eli Zaretskii [this message]
2009-08-01 19:20 ` Michael Snyder
2009-08-02 3:18 ` Michael Snyder
2009-08-02 5:58 ` Hui Zhu
2009-08-03 4:12 ` Hui Zhu
2009-08-03 18:29 ` Eli Zaretskii
2009-08-04 1:58 ` Hui Zhu
2009-08-04 2:07 ` Hui Zhu
2009-08-04 18:26 ` Eli Zaretskii
2009-08-04 20:01 ` Michael Snyder
2009-08-05 9:21 ` Hui Zhu
2009-08-05 20:19 ` [RFA/RFC] Add dump and load command to process record (file format etc) Michael Snyder
2009-08-06 2:17 ` Hui Zhu
2009-08-12 14:11 ` Michael Snyder
2009-08-12 15:16 ` Tom Tromey
2009-08-12 22:38 ` Michael Snyder
2009-08-16 0:04 ` Hui Zhu
2009-08-05 21:23 ` [RFA/RFC] Add dump and load command to process record and replay Michael Snyder
2009-08-06 3:14 ` Eli Zaretskii
2009-08-06 14:16 ` Hui Zhu
2009-08-07 3:27 ` Michael Snyder
2009-08-07 3:29 ` Hui Zhu
2009-08-07 3:34 ` Michael Snyder
2009-08-07 4:06 ` Hui Zhu
2009-08-07 8:41 ` Eli Zaretskii
2009-08-07 9:53 ` Hui Zhu
2009-08-07 12:51 ` Eli Zaretskii
2009-08-07 16:22 ` Hui Zhu
2009-08-07 17:42 ` Michael Snyder
2009-08-08 13:28 ` Hui Zhu
2009-08-10 3:09 ` Michael Snyder
2009-08-22 17:39 ` Hui Zhu
2009-08-23 1:14 ` Hui Zhu
2009-08-23 23:43 ` Michael Snyder
2009-08-24 8:20 ` Hui Zhu
2009-08-24 18:32 ` Michael Snyder
2009-08-25 8:47 ` Hui Zhu
2009-08-26 1:40 ` Michael Snyder
2009-08-26 2:59 ` Michael Snyder
2009-08-29 15:53 ` Hui Zhu
2009-08-29 18:06 ` Eli Zaretskii
2009-08-29 18:28 ` Hui Zhu
2009-08-29 20:26 ` Eli Zaretskii
2009-08-29 20:39 ` Michael Snyder
2009-08-30 3:03 ` Eli Zaretskii
2009-08-30 5:36 ` Hui Zhu
2009-08-30 23:40 ` Eli Zaretskii
2009-08-31 7:10 ` Hui Zhu
2009-09-05 3:30 ` Michael Snyder
2009-09-06 16:29 ` Hui Zhu
2009-08-29 20:05 ` Michael Snyder
2009-08-29 20:33 ` Eli Zaretskii
2009-08-29 21:20 ` Michael Snyder
2022-01-21 6:46 Simon Sobisch via Gdb-patches
2022-01-24 9:26 ` Hui Zhu via Gdb-patches
2022-04-13 12:21 ` Simon Sobisch via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83my6jq2k3.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=teawater@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox