Hi list,
How can I get command line options, especially “-o” of scan-build (output directory), in a checker function such as “checkEndAnalysis”?
Thanks,
Kihong
Hi list,
How can I get command line options, especially “-o” of scan-build (output directory), in a checker function such as “checkEndAnalysis”?
Thanks,
Kihong
Hi!
You may use the AnalyzerOptions class to retrieve analyzer specific command line options, and you can get one easily from CheckerContext. For the output directory, FrontendOptions should be used, but I don’t think you can get your hands on it from a checker callback. What would you like to achieve?
Cheers,
Kristóf
Thanks a lot.
I want to keep some additional information and intermediate results during analysis and dump it in the given output directory. What would be the simplest way?
-Kihong
Hmm. Yea, I don’t think you can do that now. It might be possible somehow, I just don’t know how, and I doubt that there is a way. The best course of action would be to add a checker option.
Mind you, there are around 10 patches on review that will overhaul the checker option interface, so you might need to rebase sometime soon on top of it
Thanks for reaching out, I might take a look at this later! There are some legitimate cases where accessing the output dir would be neat, for example, we could get rid of the “ctu-dir” option entirely.
Cheers,
Husi
Meant to say “Cheers, Kristóf”.