yosys/kernel
whitequark e9f2d3f009 kernel: Trap in `log_error()` when a debugger is attached.
The workflow of debugging fatal pass errors in Yosys is flawed in
three ways:
 1. Running Yosys under a debugger is sufficient for the debugger
    to catch some fatal errors (segfaults, aborts, STL exceptions)
    but not others (`log_error()`, `log_cmd_error()`). This is
    neither obvious nor easy to remember.
 2. To catch Yosys-specific fatal errors, it is necessary to set
    a breakpoint at `logv_error_with_prefix()`, or at least,
    `logv_error()`. This is neither obvious nor easy to remember,
    and GDB's autocomplete takes many seconds to suggest function
    names due to the large amount of symbols in Yosys.
 3. If a breakpoint is not set and Yosys encounters with such
    a fatal error, the process terminates. When debugging a crash
    that takes a long time to reproduce (or a nondeterministic crash)
    this can waste a significant amount of time.

To solve this problem, add a macro `YS_DEBUGTRAP` that acts as a hard
breakpoint (if available), and a macro `YS_DEBUGTRAP_IF_DEBUGGING`
that acts as a hard breakpoint only if debugger is present.

Then, use `YS_DEBUGTRAP_IF_DEBUGGING` in `logv_error_with_prefix()`
to obviate the need for a breakpoint on nearly every platform.

Co-Authored-By: Alberto Gonzalez <boqwxp@airmail.cc>
2020-05-03 12:02:34 +00:00
..
bitpattern.h Removed unnecessary cast. 2015-09-01 12:40:36 +02:00
calc.cc Fix mingw compile issue (2nd attempt) 2017-02-23 14:21:02 +01:00
cellaigs.cc kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
cellaigs.h Fixed trailing whitespaces 2015-07-02 11:14:30 +02:00
celledges.cc kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
celledges.h Consistent use of 'override' for virtual methods in derived classes. 2018-07-20 23:51:06 -07:00
celltypes.h kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
consteval.h kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
constids.inc kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
cost.h Use ID() in kernel/*, add simple ID:: hack (to be improved upon later) 2019-08-11 11:39:46 +02:00
driver.cc Add YS_ prefix to macros, add explanation and apply to older version as well 2020-03-13 17:19:54 +01:00
hashlib.h Merge pull request #1969 from boqwxp/pool_emplace 2020-04-22 12:10:42 -07:00
log.cc kernel: Trap in `log_error()` when a debugger is attached. 2020-05-03 12:02:34 +00:00
log.h kernel: Trap in `log_error()` when a debugger is attached. 2020-05-03 12:02:34 +00:00
macc.h kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
modtools.h Merge pull request #1845 from YosysHQ/eddie/kernel_speedup 2020-04-02 07:13:33 -07:00
register.cc Use script-style heredoc syntax for REPL heredocs. 2020-04-15 16:15:51 +00:00
register.h Add ScriptPass::run_nocheck and use for abc9 2020-03-09 14:34:22 +00:00
rtlil.cc Use default parameter value in getParam 2020-04-21 19:09:00 +02:00
rtlil.h ilang, ast: Store parameter order and default value information. 2020-04-21 19:09:00 +02:00
satgen.h kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
sigtools.h kernel: const Wire* overload -> Wire* !!! 2020-03-26 16:21:30 -07:00
timinginfo.h kernel: big fat patch to use more ID::*, otherwise ID(*) 2020-04-02 09:51:32 -07:00
utils.h Fixed trailing whitespaces 2015-07-02 11:14:30 +02:00
yosys.cc Support custom PROGRAM_PREFIX 2020-04-10 10:38:40 +02:00
yosys.h Merge pull request #1894 from YosysHQ/mingw_fix 2020-04-15 17:43:31 +02:00