aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/log.h
diff options
context:
space:
mode:
authorHenner Zeller <h.zeller@acm.org>2018-07-19 09:40:20 -0700
committerHenner Zeller <h.zeller@acm.org>2018-07-19 10:22:02 -0700
commit1a60126a3468c525ac31de930dfb139b70512a34 (patch)
tree37a93a112c809c11cdecae91ed7042bea0dd793f /kernel/log.h
parent87aef8f0cc9ee63fc8fe5eb26e6ceb73aa83b5c9 (diff)
downloadyosys-1a60126a3468c525ac31de930dfb139b70512a34.tar.gz
yosys-1a60126a3468c525ac31de930dfb139b70512a34.tar.bz2
yosys-1a60126a3468c525ac31de930dfb139b70512a34.zip
Provide source-location logging.
o Provide log_file_warning() and log_file_error() that prefix the log message with <filename>:<lineno>: to be easily picked up by IDEs that need to step through errors. o Simplify some duplicate logging code in kernel/log.cc o Use the new log functions in genrtlil.
Diffstat (limited to 'kernel/log.h')
-rw-r--r--kernel/log.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/log.h b/kernel/log.h
index a2aacfd4d..0b4905c3a 100644
--- a/kernel/log.h
+++ b/kernel/log.h
@@ -73,8 +73,13 @@ YS_NORETURN void logv_error(const char *format, va_list ap) YS_ATTRIBUTE(noretur
void log(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2));
void log_header(RTLIL::Design *design, const char *format, ...) YS_ATTRIBUTE(format(printf, 2, 3));
void log_warning(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2));
+
+// Log with filename to report a problem in a source file.
+void log_file_warning(const std::string &filename, int lineno, const char *format, ...) YS_ATTRIBUTE(format(printf, 3, 4));
+
void log_warning_noprefix(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2));
YS_NORETURN void log_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2), noreturn);
+void log_file_error(const string &filename, int lineno, const char *format, ...) YS_ATTRIBUTE(format(printf, 3, 4), noreturn);
YS_NORETURN void log_cmd_error(const char *format, ...) YS_ATTRIBUTE(format(printf, 1, 2), noreturn);
void log_spacer();