PDP11, PDP10, VAX, AltairZ80: enhanced the macro which aborts on an unexpected status from an expression with side effects to also write a message to sim_log or sim_deb if they happen to be open.
This commit is contained in:
parent
a15858315a
commit
6b1dd7065f
1 changed files with 4 additions and 1 deletions
|
@ -747,7 +747,10 @@ typedef struct sim_bitfield BITFIELD;
|
|||
/* This replaces any references to "assert()" which should never be invoked */
|
||||
/* with an expression which causes side effects (i.e. must be executed for */
|
||||
/* the program to work correctly) */
|
||||
#define ASSURE(_Expression) if (_Expression) {fprintf(stderr, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); abort();} else (void)0
|
||||
#define ASSURE(_Expression) if (_Expression) {fprintf(stderr, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
|
||||
if (sim_log) fprintf(sim_log, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
|
||||
if (sim_deb) fprintf(sim_deb, "%s failed at %s line %d\n", #_Expression, __FILE__, __LINE__); \
|
||||
abort();} else (void)0
|
||||
|
||||
/* Asynch/Threaded I/O support */
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue