aboutsummaryrefslogtreecommitdiff
path: root/riscv/log_file.h
AgeCommit message (Collapse)AuthorFilesLines
2020-03-27Write execution logs to a named log file (#409)Rupert Swarbrick1-0/+37
This patch adds a --log argument to spike. If not given, the behaviour is unchanged: messages logging execution of instructions and (if commit logging is enabled) commits go to stderr. If --log=P is given, Spike now writes these messages to a log file at the path P. This is nice, because they are no longer tangled up with other errors and warnings. The code is mostly plumbing: passing a FILE* object through to the functions that were using stderr. I've written a simple "log_file_t" class, which opens a log file if necessary and yields it or stderr.