[PATCH] D27238: [libFuzzer] Diff 7 - Improve Signal Handler interface.
Marcos Pividori via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 30 19:30:59 PST 2016
mpividori added inline comments.
================
Comment at: lib/Fuzzer/FuzzerUtil.h:44
// Platform specific functions.
-void SetTimer(int Seconds);
-
-void SetSigSegvHandler();
-void SetSigBusHandler();
-void SetSigAbrtHandler();
-void SetSigIllHandler();
-void SetSigFpeHandler();
-void SetSigIntHandler();
-void SetSigTermHandler();
+struct SignalHandlerOptions {
+ typedef void (*HandlerT)();
----------------
kcc wrote:
> do you need this level of indirection?
@kcc
+ This way we make explicit which callback function will be registered for a specific signal. In previous implementation, when calling functions like `SetSigSegvHandler()`, it's not clear which callback will be called for that given signal.
+ With these changes we decouple the implementation of FuzzerUtils from the rest of the Fuzzer's implementation. In fact, you can see I remove the includes: #include "FuzzerInternal.h" from the FuzzerUtil*.cpp implementations.
+ This changes simplify the implementation of Windows's exception handling.
Repository:
rL LLVM
https://reviews.llvm.org/D27238
More information about the llvm-commits
mailing list