[VFATLIB]: Few "adjustments" (inspired from the code of DPRINT1) to diagnose

CORE-10932 CORE-10981 #comment Please retest with revision 71016 and make a debug log!

svn path=/trunk/; revision=71016
This commit is contained in:
Hermès Bélusca-Maïto
2016-03-17 01:11:10 +00:00
parent 02ce356779
commit 14590f92cf
2 changed files with 20 additions and 10 deletions
+8 -8
View File
@@ -42,7 +42,7 @@ typedef struct _link {
DECLSPEC_NORETURN // __attribute((noreturn))
void exit(int exitcode)
{
DbgBreakPoint();
// DbgBreakPoint();
NtTerminateProcess(NtCurrentProcess(), exitcode);
/* Should never get here */
@@ -50,7 +50,7 @@ void exit(int exitcode)
}
DECLSPEC_NORETURN // __attribute((noreturn))
void die(const char *msg, ...)
void die_func(const char *msg, ...) // die
{
va_list args;
@@ -59,14 +59,14 @@ void die(const char *msg, ...)
DPRINT1("Unrecoverable problem!\n");
VfatPrintV((char*)msg, args);
va_end(args);
// fprintf(stderr, "\n");
VfatPrint("\n");
// // fprintf(stderr, "\n");
// VfatPrint("\n");
exit(1);
}
DECLSPEC_NORETURN // __attribute((noreturn))
void pdie(const char *msg, ...)
void pdie_func(const char *msg, ...) // pdie
{
va_list args;
@@ -75,9 +75,9 @@ void pdie(const char *msg, ...)
DPRINT1("Unrecoverable problem!\n");
VfatPrintV((char*)msg, args);
va_end(args);
// fprintf(stderr, ":%s\n", strerror(errno));
// VfatPrint(":%s\n", strerror(errno));
VfatPrint("\n");
// // fprintf(stderr, ":%s\n", strerror(errno));
// // VfatPrint(":%s\n", strerror(errno));
// VfatPrint("\n");
exit(1);
}
+12 -2
View File
@@ -28,12 +28,22 @@
#define _COMMON_H
DECLSPEC_NORETURN // __attribute((noreturn))
void die(const char *msg, ...);
// void die(const char *msg, ...);
void die_func(const char *msg, ...);
#define die(msg, ...) \
do { \
die_func("DIE! (%s:%d) " msg "\n", __RELFILE__, __LINE__, ##__VA_ARGS__) \
} while (0)
/* Displays a prinf-style message and terminates the program. */
DECLSPEC_NORETURN // __attribute((noreturn))
void pdie(const char *msg, ...);
// void pdie(const char *msg, ...);
void pdie_func(const char *msg, ...);
#define pdie(msg, ...) \
do { \
pdie_func("P-DIE! (%s:%d) " msg "\n", __RELFILE__, __LINE__, ##__VA_ARGS__) \
} while (0)
/* Like die, but appends an error message according to the state of errno. */