Record replay file conditionally in c program and reply it later

Andy Fan
Sun Nov 28 13:54:40 GMT 2021


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)
   a_very_complex_func();  -- rerun this function.
   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?


Best Regards
Andy Fan

More information about the Gdb mailing list