diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 53eadc2f..eba91db5 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -35,4 +35,13 @@ jobs: run: ./ci_setup_test.sh - name: Test + id: test run: ./ci_test.sh + + - name: Upload failure logs + if: ${{ always() && (steps.test.outcome == 'failure') }} + uses: actions/upload-artifact@v6 + with: + name: failure-logs + path: ${{ env.DIR_TEST_DOSEMU }}/test_* + diff --git a/fdpp/thunks.cc b/fdpp/thunks.cc index 45266768..aa5d74ad 100644 --- a/fdpp/thunks.cc +++ b/fdpp/thunks.cc @@ -233,9 +233,9 @@ void fdvprintf(const char *format, va_list vl) fdpp->print(FDPP_PRINT_TERMINAL, format, vl); } -static void fdlogvprintf(const char *format, va_list vl) +static void fdlogvprintf(int prio, const char *format, va_list vl) { - fdpp->print(FDPP_PRINT_LOG, format, vl); + fdpp->print(prio, format, vl); } void fdprintf(const char *format, ...) @@ -250,9 +250,27 @@ void fdprintf(const char *format, ...) void fdlogprintf(const char *format, ...) { va_list vl; + int prio = FDPP_PRINT_LOG; + + if (strcmp("%s", format) == 0) { // The string has been preformatted and we + const char *s; // may need to move an @ from args to format + va_start(vl, format); + s = va_arg(vl, const char *); + va_end(vl); + + if (s[0] == '@') { + fdlogprintf("@%s", s + 1); // call ourselves again + return; + } + } + + if (format[0] == '@') { + prio |= FDPP_PRINT_LOG_NOPREFIX; + format++; + } va_start(vl, format); - fdlogvprintf(format, vl); + fdlogvprintf(prio, format, vl); va_end(vl); } diff --git a/hdr/debug.h b/hdr/debug.h index 47fdccff..6fc7fb30 100644 --- a/hdr/debug.h +++ b/hdr/debug.h @@ -48,6 +48,30 @@ void logprintf(const char *format, ...) PRINTF(1); /* use to limit output to debug builds */ #ifdef DEBUG + +/* enable or disable various chunks of debug output */ + +/* show stored IRQ vectors */ +#define DEBUGIRQ +/* display output during kernel config processing phase */ +#define DEBUGCFG +/* display info on various DOS functions (dosfns.c) */ +#define DEBUGDOSFNS +/* extra debug output related to chdir */ +#define CHDIR_DEBUG +/* extra debug output related to findfirst */ +#define FIND_DEBUG +/* display info on various DOS directory functions (fatdir.c) */ +#define DEBUGFATDIR +/* extra output during read/write operations */ +#define DSK_DEBUG +/* display info on various FAT handling functions (fatfs.c) */ +#define DEBUGFATFS +/* debug truename */ +#define DEBUG_TRUENAME +/* display nls conversion */ +#define NLS_DEBUG + #ifdef DEBUG_PRINT_COMPORT #define DebugPrintf(x) dbgc_printf x #else @@ -61,12 +85,6 @@ void logprintf(const char *format, ...) PRINTF(1); keep around for later use. */ #define DDebugPrintf(x) - -/* enable or disable various chunks of debug output */ - -/* show stored IRQ vectors */ -/* #define DEBUGIRQ */ - /* show output related to moving kernel into HMA */ #ifdef DEBUG #define HMAInitPrintf(x) DebugPrintf(x) @@ -74,30 +92,18 @@ void logprintf(const char *format, ...) PRINTF(1); #define HMAInitPrintf(x) #endif -/* display output during kernel config processing phase */ -/* #define DEBUGCFG */ #ifdef DEBUGCFG #define CfgDbgPrintf(x) DebugPrintf(x) #else #define CfgDbgPrintf(x) #endif -/* display info on various DOS functions (dosfns.c) */ -/* #define DEBUGDOSFNS */ #ifdef DEBUGDOSFNS #define DFnsDbgPrintf(x) DebugPrintf(x) #else #define DFnsDbgPrintf(x) #endif -/* extra debug output related to chdir */ -/* #define CHDIR_DEBUG */ - -/* extra debug output related to findfirst */ -/* #define FIND_DEBUG */ - -/* display info on various DOS directory functions (fatdir.c) */ -/* #define DEBUGFATDIR */ #ifdef DEBUGFATDIR #define FDirDbgPrintf(x) DebugPrintf(x) #else @@ -107,26 +113,18 @@ void logprintf(const char *format, ...) PRINTF(1); /* extra debug output when transferring I/O chunks of data */ /* #define DISPLAY_GETBLOCK */ -/* extra output during read/write operations */ -/* #define DSK_DEBUG */ - -/* display info on various FAT handling functions (fatfs.c) */ -/* #define DEBUGFATFS */ #ifdef DEBUGFATFS #define FatFSDbgPrintf(x) DebugPrintf(x) #else #define FatFSDbgPrintf(x) #endif -/* debug truename */ -/* #define DEBUG_TRUENAME */ #ifdef DEBUG_TRUENAME #define tn_printf(x) DebugPrintf(x) #else #define tn_printf(x) #endif - /* ensure printf is prototyped */ #if defined(DEBUG) || defined(DEBUGIRQ) || defined(DEBUGCFG) || \ defined(DEBUGDOSFNS) || defined(CHDIR_DEBUG) || defined(FIND_DEBUG) || \ diff --git a/include/fdpp/thunks.h b/include/fdpp/thunks.h index 91407e3b..824493bb 100644 --- a/include/fdpp/thunks.h +++ b/include/fdpp/thunks.h @@ -43,6 +43,7 @@ int FdppCall(struct vm86_regs *regs); int FdppCtrl(int idx, struct vm86_regs *regs); enum { FDPP_PRINT_LOG, FDPP_PRINT_TERMINAL, FDPP_PRINT_SCREEN }; +#define FDPP_PRINT_LOG_NOPREFIX (1 << 16) enum { ASM_CALL_OK, ASM_CALL_ABORT }; enum { FDPP_RET_ABORT = -1, FDPP_RET_OK, FDPP_RET_NORET }; diff --git a/kernel/dosfns.c b/kernel/dosfns.c index b43e2878..50f750ca 100644 --- a/kernel/dosfns.c +++ b/kernel/dosfns.c @@ -27,6 +27,7 @@ /****************************************************************/ #include "portab.h" +#include "debug.h" #ifdef VERSION_STRINGS static BYTE *dosfnsRcsId = @@ -1126,7 +1127,7 @@ COUNT DosFindFirst(UCOUNT attr, const char FAR * name) SAttr = (BYTE) attr; #if defined(FIND_DEBUG) - DebugPrintf(("Remote Find: n='%Fs\n", PriPathName)); + DebugPrintf(("Remote Find: n='%s\n", GET_PTR(PriPathName))); #endif dta = &sda_tmp_dm; diff --git a/kernel/dsk.c b/kernel/dsk.c index 726b9c8c..93660cfe 100644 --- a/kernel/dsk.c +++ b/kernel/dsk.c @@ -25,6 +25,7 @@ /****************************************************************/ #include "portab.h" +#include "debug.h" #include "globals.h" #include "dyndata.h" @@ -482,8 +483,8 @@ STATIC WORD getbpb(ddt FAR * pddt) #ifdef DSK_DEBUG DebugPrintf(("BPB_NSECS = %04x\n", pbpbarray->bpb_nsecs)); DebugPrintf(("BPB_NHEADS = %04x\n", pbpbarray->bpb_nheads)); - DebugPrintf(("BPB_HIDDEN = %08lx\n", pbpbarray->bpb_hidden)); - DebugPrintf(("BPB_HUGE = %08lx\n", pbpbarray->bpb_huge)); + DebugPrintf(("BPB_HIDDEN = %04x\n", pbpbarray->bpb_hidden)); + DebugPrintf(("BPB_HUGE = %04x\n", pbpbarray->bpb_huge)); #endif return 0; diff --git a/kernel/fatfs.c b/kernel/fatfs.c index cc2900cd..429adef7 100644 --- a/kernel/fatfs.c +++ b/kernel/fatfs.c @@ -28,6 +28,7 @@ /****************************************************************/ #include "portab.h" +#include "debug.h" #include "globals.h" #ifdef VERSION_STRINGS @@ -1135,8 +1136,8 @@ STATIC COUNT dos_extend(f_node_ptr fnp) boff = (UWORD)(fnp->f_offset % secsize); #ifdef DSK_DEBUG - DebugPrintf(("write %d links; dir offset %ld, cluster %d\n", - fnp->f_count, fnp->f_dmp->dm_entry, fnp->f_cluster)); + DebugPrintf(("dir offset %ld, cluster %d\n", + fnp->f_dmp->dm_entry, fnp->f_cluster)); #endif xfr_cnt = count < (ULONG) secsize - boff ? @@ -1432,8 +1433,8 @@ long rwblock(COUNT fd, VOID FAR * buffer, UCOUNT count, int mode) normal_xfer: #ifdef DSK_DEBUG - DebugPrintf(("r/w %d links; dir offset %d, cluster %d, mode %x\n", - fnp->f_count, fnp->f_dmp->dm_entry, fnp->f_cluster, mode)); + DebugPrintf(("dir offset %d, cluster %d, mode %x\n", + fnp->f_dmp->dm_entry, fnp->f_cluster, mode)); #endif /* Get the block we need from cache */ diff --git a/kernel/initdisk.c b/kernel/initdisk.c index c63fbb33..73b04a79 100644 --- a/kernel/initdisk.c +++ b/kernel/initdisk.c @@ -794,11 +794,11 @@ STATIC int LBA_Get_Drive_Parameters(int drive, struct DriveParamS *driveParam) driveParam->driveno = drive; - DebugPrintf(("drive %02Xh total: C = %u, H = %u, S = %u,", + DebugPrintf(("drive %02Xh total: C = %u, H = %u, S = %u, total size %uMB\n", drive, driveParam->chs.Cylinder, - driveParam->chs.Head, driveParam->chs.Sector)); - DebugPrintf((" total size %uMB\n", driveParam->total_sectors / 2048)); + driveParam->chs.Head, driveParam->chs.Sector, + driveParam->total_sectors / 2048)); ErrorReturn: diff --git a/kernel/newstuff.c b/kernel/newstuff.c index 0b5da4d3..e9868e3f 100644 --- a/kernel/newstuff.c +++ b/kernel/newstuff.c @@ -106,10 +106,6 @@ long DosMkTmp(char FAR * pathname, UWORD attr) return rc; } -#ifdef DEBUG -#define DEBUG_TRUENAME -#endif - #define drLetterToNr(dr) ((unsigned char)((dr) - 'A')) /* Convert an uppercased drive letter into the drive index */ #define drNrToLetter(dr) ((dr) + 'A') @@ -321,7 +317,7 @@ COUNT truename(__XFAR(const char) src, char FAR *dest, COUNT mode) fmemcpy(&TempCDS, cdsEntry, sizeof(struct cds)); tn_printf(("CDS entry: #%u @%P (%u) '%s'\n", result, GET_FP32(cdsEntry), - TempCDS.cdsBackslashOffset, GET_FP32(TempCDS.cdsCurrentPath))); + TempCDS.cdsBackslashOffset, GET_PTR(TempCDS.cdsCurrentPath))); /* is the current_ldt thing necessary for compatibly?? -- 2001/09/03 ska*/ current_ldt = cdsEntry; @@ -429,7 +425,8 @@ COUNT truename(__XFAR(const char) src, char FAR *dest, COUNT mode) if (!(mode & CDS_MODE_SKIP_PHYSICAL)) { - tn_printf(("SUBSTing from: %s\n", cp)); + tn_printf(("SUBSTing from: %s\n", GET_PTR(cp))); + /* What to do now: the logical drive letter will be replaced by the hidden portion of the associated path. This is necessary for NETWORK and SUBST drives. For local drives it should not harm. diff --git a/kernel/nls.c b/kernel/nls.c index 9f1f5c05..f63673b1 100644 --- a/kernel/nls.c +++ b/kernel/nls.c @@ -34,6 +34,7 @@ * ==ska*/ #include "portab.h" +#include "debug.h" #include "globals.h" #include "pcb.h" #include "nls.h" @@ -260,11 +261,10 @@ STATIC VOID upMMem(UBYTE FAR * map, UBYTE FAR * str, unsigned len) oldStr = str; oldLen = len; - log(("NLS: upMMem(): len=%u, %04x:%04x=\"", len, FP_SEG(str), - FP_OFF(str))); + DebugPrintf(("NLS: upMMem(): len=%u, %P=\"", len, GET_FP32(str))); for (c = 0; c < len; ++c) - DebugPrintf(("%c", str[c] > 32 ? str[c] : '.')); - DebugPrintf(("\"\n")); + DebugPrintf(("@%c", str[c] > 32 ? str[c] : '.')); + DebugPrintf(("@\"\n")); #endif if (len) do @@ -279,8 +279,8 @@ STATIC VOID upMMem(UBYTE FAR * map, UBYTE FAR * str, unsigned len) #ifdef NLS_DEBUG DebugPrintf(("NLS: upMMem(): result=\"")); for (c = 0; c < oldLen; ++c) - DebugPrintf(("%c", oldStr[c] > 32 ? oldStr[c] : '.')); - DebugPrintf(("\"\n")); + DebugPrintf(("@%c", oldStr[c] > 32 ? oldStr[c] : '.')); + DebugPrintf(("@\"\n")); #endif } @@ -522,11 +522,10 @@ VOID DosUpFMem(VOID FAR * str, unsigned len) { #ifdef NLS_DEBUG unsigned c; - log(("NLS: DosUpFMem(): len=%u, %04x:%04x=\"", len, FP_SEG(str), - FP_OFF(str))); + DebugPrintf(("NLS: DosUpFMem(): len=%u, %P=\"", len, GET_FP32(str))); for (c = 0; c < len; ++c) - DebugPrintf(("%c", ((char FAR *)str)[c] > 32 ? ((char FAR *)str)[c] : '.')); - DebugPrintf(("\"\n")); + DebugPrintf(("@%c", ((char FAR *)str)[c] > 32 ? ((char FAR *)str)[c] : '.')); + DebugPrintf(("@\"\n")); #endif if (nlsInfo.actPkg->flags & NLS_FLAG_DIRECT_FUPCASE) nlsFUpMem(nlsInfo.actPkg, str, len); @@ -697,10 +696,10 @@ UWORD ASMCFUNC syscall_MUX14(iregs FAR * regs) { unsigned j; BYTE FAR *p; - log(("NLS: MUX14(FILE_UPMEM): len=%u, %04x:%04x=\"", regs->CX, regs->ES, regs->DI)); + DebugPrintf(("NLS: MUX14(FILE_UPMEM): len=%u, %04x:%04x=\"", regs->CX, regs->ES, regs->DI)); for (j = 0, p = MK_FP(regs->ES, regs->DI); j < regs->CX; ++j) - DebugPrintf(("%c", p[j] > 32 ? p[j] : '.')); - DebugPrintf(("\"\n")); + DebugPrintf(("@%c", p[j] > 32 ? p[j] : '.')); + DebugPrintf(("@\"\n")); } #endif nlsFUpMem(nls, MK_FP(regs->ES, regs->DI), regs->CX);