Enhanced debug output to mark debug info from non main threads with a + at the beginning of the debug message
This commit is contained in:
parent
8f851d2cbc
commit
038c5d27fb
2 changed files with 7 additions and 3 deletions
8
scp.c
8
scp.c
|
@ -6220,7 +6220,7 @@ return SCPE_OK;
|
||||||
/* Debug printout routines, from Dave Hittner */
|
/* Debug printout routines, from Dave Hittner */
|
||||||
|
|
||||||
const char* debug_bstates = "01_^";
|
const char* debug_bstates = "01_^";
|
||||||
const char* debug_fmt = "DBG(%.0f)> %s %s: ";
|
const char* debug_fmt = "DBG(%.0f)%s> %s %s: ";
|
||||||
int32 debug_unterm = 0;
|
int32 debug_unterm = 0;
|
||||||
|
|
||||||
/* Finds debug phrase matching bitmask from from device DEBTAB table */
|
/* Finds debug phrase matching bitmask from from device DEBTAB table */
|
||||||
|
@ -6250,7 +6250,7 @@ static void sim_debug_prefix (uint32 dbits, DEVICE* dptr)
|
||||||
{
|
{
|
||||||
if (!debug_unterm) {
|
if (!debug_unterm) {
|
||||||
char* debug_type = get_dbg_verb (dbits, dptr);
|
char* debug_type = get_dbg_verb (dbits, dptr);
|
||||||
fprintf(sim_deb, debug_fmt, sim_gtime(), dptr->name, debug_type);
|
fprintf(sim_deb, debug_fmt, sim_gtime(), AIO_MAIN_THREAD ? "" : "+", dptr->name, debug_type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6387,7 +6387,9 @@ if (sim_deb && (dptr->dctrl & dbits)) {
|
||||||
if (debug_unterm)
|
if (debug_unterm)
|
||||||
fprintf (sim_deb, "%.*s\r\n", i-j, &buf[j]);
|
fprintf (sim_deb, "%.*s\r\n", i-j, &buf[j]);
|
||||||
else /* print prefix when required */
|
else /* print prefix when required */
|
||||||
fprintf (sim_deb, "DBG(%.0f)> %s %s: %.*s\r\n", sim_gtime(), dptr->name, debug_type, i-j, &buf[j]);
|
fprintf (sim_deb, "DBG(%.0f)%s> %s %s: %.*s\r\n", sim_gtime(),
|
||||||
|
AIO_MAIN_THREAD ? "" : "+",
|
||||||
|
dptr->name, debug_type, i-j, &buf[j]);
|
||||||
debug_unterm = 0;
|
debug_unterm = 0;
|
||||||
}
|
}
|
||||||
j = i + 1;
|
j = i + 1;
|
||||||
|
|
|
@ -682,6 +682,7 @@ extern int32 sim_asynch_inst_latency;
|
||||||
#define AIO_TLS
|
#define AIO_TLS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define AIO_MAIN_THREAD (pthread_equal ( pthread_self(), sim_asynch_main_threadid ))
|
||||||
#define AIO_LOCK \
|
#define AIO_LOCK \
|
||||||
pthread_mutex_lock(&sim_asynch_lock)
|
pthread_mutex_lock(&sim_asynch_lock)
|
||||||
#define AIO_UNLOCK \
|
#define AIO_UNLOCK \
|
||||||
|
@ -1012,6 +1013,7 @@ extern int32 sim_asynch_inst_latency;
|
||||||
#define AIO_VALIDATE
|
#define AIO_VALIDATE
|
||||||
#define AIO_CHECK_EVENT
|
#define AIO_CHECK_EVENT
|
||||||
#define AIO_INIT
|
#define AIO_INIT
|
||||||
|
#define AIO_MAIN_THREAD TRUE
|
||||||
#define AIO_LOCK
|
#define AIO_LOCK
|
||||||
#define AIO_UNLOCK
|
#define AIO_UNLOCK
|
||||||
#define AIO_CLEANUP
|
#define AIO_CLEANUP
|
||||||
|
|
Loading…
Add table
Reference in a new issue