Open moralismercatus opened 9 years ago
Perhaps the best solution (suggested by Bo) is to simply not use preload. Just separate command line arguments and files and call the executable natively with that data.
Once this is done, preload should be unnecessary.
Previous comment contains an oversight. Arguments still require preload, as not all input is valid command line input. This, in turn, raises the question of whether command line input should be implicitly constrained to valid command line input in which case the former comment is reasonable.
I haven't found a way to run valgrind as follows:
Instead, I have to run it this way:
In this case, I need to specially check whether we've preloaded main of the target executable, or valgrind, or another program that valgrind calls before executing the target binary.
This isn't a huge concern, and the check is fine as a workaround (there's some overhead). Just if you have some a little time or insight, it may be worthwhile to revisit.