[Lldb-commits] [PATCH] D77759: [lldb/Reproducers] Fix passive replay for functions returning string as (char*, size_t).

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 16 02:14:22 PDT 2020

labath added a comment.

The thing which bugs me here (besides the duplication, which I think we now know how to handle) is that the definition of the behavior for the char*+size functions is spread out over REGISTER and RECORD macros -- one define the behavior of active replay, one for passive.

I sort of get that this is because the two modes are fairly different, but I think it still would be nice to centralize that, and I think that with some thought, that might be possible. As I understand it, tight now, the "active" redirection works by passing a pointer which completely replaces the behavior of the called method. In reality the replacing function will eventually call the replaced function anyway, with some fixups applied. What if, instead of replacing the function completely, we passed a pair of callbacks which would run before+after the original function. The first callback could apply any necessary fixups to the deserialized arguments, and the second one could (if in passive mode) translate the modifications done by the function into the "real" arguments. That way, we wouldn't need to do anything special in the RECORD macro...

Other ideas may be possible too...




More information about the lldb-commits mailing list