Closed wuruoyu closed 4 years ago
Hi @wuruoyu,
In principle, C++ I/O is already supported: we hook the libc functions that libc++ uses to implement C++ I/O. So if you have an instrumented C++ runtime, things should already work as expected. For example, std::fstream
and friends are implemented with fopen
. Similarly, we support std::cin
for reading from standard input.
Have you found a use case where symbolic C++ I/O doesn't work as it should? If so, would you mind sharing the program so that we can investigate?
Cheers, Sebastian
Oh it's my bad. It seems that I set up the SYMCC_INPUT_FILE incorrectly. Now it works as expected, thank you!
The mechanism is a bit fragile at the moment because we expect the contents of SYMCC_INPUT_FILE
as a substring in the file name that the program passes to open
or fopen
(possibly via the C++ standard library). I guess it would be better to transform both names to some canonical form and then check for an exact match...
Anyway, glad it works for you now!
Hi,
I am wondering do you have any plan to support the interception of C++ file I/O function (e.g. std::getline). Thank you in advance!
Ruoyu