From: Andy Fan <zhihui.fan1213@gmail.com>
To: gdb@sourceware.org
Subject: Record replay file conditionally in c program and reply it later
Date: Sun, 28 Nov 2021 21:54:40 +0800 [thread overview]
Message-ID: <CAKU4AWrjD_TjFkDPUYZH32o-WjTPy+qV05=f3gW7Uo5xfgVhcA@mail.gmail.com> (raw)
Hi:
Suppose we have code like this:
int res = a_very_complex_func();
assert(res > 0); -- crashed.
And the above case is not easy to reproduce. so I want to record and reply
to the situation later.
int res = a_very_complex_func();
if (res <= 0)
{
record_gdb_file_start('/tmp/assert_gt_0');
a_very_complex_func(); -- rerun this function.
record_gdb_file_stop();
Assert(res > 0) -- let is crash
}
Later, I can use gdb with /tmp/assert_gt_0 file to replay the workload. Is
it something we can do now?
Thanks!
--
Best Regards
Andy Fan
reply other threads:[~2021-11-28 13:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAKU4AWrjD_TjFkDPUYZH32o-WjTPy+qV05=f3gW7Uo5xfgVhcA@mail.gmail.com' \
--to=zhihui.fan1213@gmail.com \
--cc=gdb@sourceware.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).