-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(examples/vhdl/external_buffer): use the reference C sources
* add sigabrt.md
- Loading branch information
Showing
3 changed files
with
34 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
When VHDL 1993 is used, the simulation is terminated with an `abort`, which prevents the user from running post-checks. | ||
These are some snippets to test it. See https://github.com/VUnit/vunit/pull/469#issuecomment-485723516. | ||
|
||
``` python | ||
https://bugs.python.org/issue12423 | ||
def handler(signum, frame): | ||
print('Signal handler called with signal', signum) | ||
import signal | ||
signal.signal(signal.SIGABRT, handler) | ||
import os | ||
os.abort() | ||
``` | ||
|
||
``` c | ||
#include <signal.h> | ||
|
||
void sigabrtHandler(int sig_num) | ||
{ | ||
// Reset handler to catch SIGINT next time. Refer http://en.cppreference.com/w/c/program/signal | ||
signal(SIGABRT, sigabrtHandler); | ||
printf("\nSIGABRT caught!\n"); | ||
fflush(stdout); | ||
} | ||
|
||
signal(SIGABRT, sigabrtHandler); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters