This adds a command interpreter fuzzer to LLDB's fuzzing library. The input data from the fuzzer is used as input for the command interpreter. Input data for the fuzzer is guided by a dictionary of keywords used in LLDB, such as "breakpoint", "target" and others.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/CMakeLists.txt | ||
---|---|---|
4 | I assume we don't need this anymore if we're using the dummy target? | |
22 | Shouldn't we use an absolute path for the input dictionary? Something like ${CMAKE_CURRENT_SOURCE_DIR}/inputdictionary.txt | |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
45 | Why do we need a breakpoint? |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/CMakeLists.txt | ||
---|---|---|
4 | Yes this isn't necessary anymore, I'll remove it and update the revision. | |
22 | Yes an absolute path is better here, I'll add it and update the revision. | |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
45 | This was a leftover from when I ran this fuzzer with a non-dummy target, removing it doesn't seem to affect the fuzzer so I can take this line out and update the diff. |
Removed ObjectYAML link component from CMakeLists file, changed fuzzer invocation to use a relative path for the dictionary file, removed line that sets a breakpoint in the fuzzer's LLDB process.
lldb/tools/lldb-fuzzer/CMakeLists.txt | ||
---|---|---|
2–3 | nit: I'd sort these alphabetically | |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/CMakeLists.txt | ||
16 | I don't think this used any longer. | |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
2–3 | ASCII art needs fixing :-) | |
18 | Not used? |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/CMakeLists.txt | ||
---|---|---|
16 | Ok, I can remove this library. | |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
18 | Not in this file, but removing that include causes the compiler to not recognize the llvm and lldb_fuzzer namespaces. That's also fine in this file because neither of those namespaces are used but I still found it strange. | |
40 | Oh shoot, I didn't notice. Would interpreter or ci be a better variable name? |
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
---|---|---|
40 | I was more annoyed by the fact that the variable started with this. It's a reserved keyword in C++ and that can it make error prone. However, ci is a great candidate for this :) |
Sorted subdirectories alphabetically in top-level CMakeLists file.
Removed lldbfuzzer link library in command interpreter CMakeLists file.
Fixed ASCII art in command interpreter source file, renamed thisinterpreter to ci, removed unused include in command interpreter source file.
lldb/tools/lldb-fuzzer/lldb-commandinterpreter-fuzzer/lldb-commandinterpreter-fuzzer.cpp | ||
---|---|---|
40 | Ah, good point about that. I renamed it to ci. |
Updated CMakeLists file to save fuzzer artifacts (the files that the fuzzer writes when an input causes the program being fuzzed to fail) to a directory in the user's build directory, instead of saving them in the user's source directory. Also change fuzzer invocation to add a prefix to artifacts so that it is easier to identify them.
Added a subdirectory to the top-level build directory. This directory will hold directories for the artifacts of various fuzzers. Also corrected a typo in the command interpreter CMakeLists file.
nit: I'd sort these alphabetically