H316: Fix debugging host interface messages.

This commit is contained in:
Lars Brinkhoff 2021-10-20 10:22:35 +02:00
parent 4e162c0586
commit 5dcc00ea10
2 changed files with 5 additions and 3 deletions

View file

@ -172,6 +172,7 @@ DEBTAB hi_debug[] = {
{"WARN", IMP_DBG_WARN}, // print warnings that would otherwise be suppressed {"WARN", IMP_DBG_WARN}, // print warnings that would otherwise be suppressed
{"UDP", IMP_DBG_UDP}, // print all UDP messages sent and received {"UDP", IMP_DBG_UDP}, // print all UDP messages sent and received
{"IO", IMP_DBG_IOT}, // print all program I/O instructions {"IO", IMP_DBG_IOT}, // print all program I/O instructions
{"MSG", HI_DBG_MSG}, // decode and print all messages
{0} {0}
}; };
@ -292,12 +293,12 @@ void hi_debug_hio (uint16 line, uint32 dmc, const char *ptext)
void hi_debug_msg (uint16 line, uint16 next, uint16 count, const char *ptext) void hi_debug_msg (uint16 line, uint16 next, uint16 count, const char *ptext)
{ {
uint16 i; char buf[CBUFSIZE]; int len = 0; uint16 i; char buf[CBUFSIZE]; int len = 0;
if (!ISHDBG(line, MI_DBG_MSG)) return; if (!ISHDBG(line, HI_DBG_MSG)) return;
sim_debug(MI_DBG_MSG, PDEVICE(line), "message %s (length=%d)\n", ptext, count); sim_debug(HI_DBG_MSG, PDEVICE(line), "message %s (length=%d)\n", ptext, count);
for (i = 1, len = 0; i <= count; ++i) { for (i = 1, len = 0; i <= count; ++i) {
len += sprintf(buf+len, "%06o ", M[next+i-1]); len += sprintf(buf+len, "%06o ", M[next+i-1]);
if (((i & 7) == 0) || (i == count)) { if (((i & 7) == 0) || (i == count)) {
sim_debug(MI_DBG_MSG, PDEVICE(line), "- %s\n", buf); len = 0; sim_debug(HI_DBG_MSG, PDEVICE(line), "- %s\n", buf); len = 0;
} }
} }
} }

View file

@ -128,6 +128,7 @@
#define IMP_DBG_IOT 0x0002 // all: trace all program I/O instructions #define IMP_DBG_IOT 0x0002 // all: trace all program I/O instructions
#define IMP_DBG_UDP 0x0004 // all: trace UDP packets #define IMP_DBG_UDP 0x0004 // all: trace UDP packets
#define MI_DBG_MSG 0x8000 // modem: decode and print all messages #define MI_DBG_MSG 0x8000 // modem: decode and print all messages
#define HI_DBG_MSG 0x8000 // host interface: decode and print all messages
#define WDT_DBG_LIGHTS 0x8000 // wdt: show status light changes #define WDT_DBG_LIGHTS 0x8000 // wdt: show status light changes
// Synonyms for DIB and UNIT fields ... // Synonyms for DIB and UNIT fields ...