This patch enables an external tool to register PrintfAndReportCallback.
The function needs to end up in the dynamic symbol table, so that a dynamic library can call the function.
Details
- Reviewers
kcc
Diff Detail
Event Timeline
The logic is too complex.
If you want to disable colors, just disable them with a separate flag.
If you want to disable logging to a file, just use log_file=/dev/null
I cannot find a log_file option, only a log_path option. And this option is not compatible with /dev/null, since it adds ".$PID" to the path prefix.
I reduced the patch to just suppress the output to file for a registered output callback.
With some compiler versions, SetPrintfAndReportCallback gets the .hidden flag. I need to access the symbol from a 3rd party library.
So I added SANITIZER_INTERFACE_ATTRIBUTE to have the symbol visible.
- I see two independent changes here. If so, please split them into two patches
- most changes need tests.
- Maybe instead of doing this, introduce some logic to treat log_path=/dev/null as a special supported case?
I updated this differential to only export the function.
To make the function available with all sanitizers, I created a new extra file that is included for all sanitizers.