summaryrefslogtreecommitdiff
path: root/errlog.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2020-07-23 20:29:52 -0400
committerPeter Jones <pjones@redhat.com>2020-07-25 22:14:08 -0400
commitfc4368fed53837e00d303600d8b628cb0392b629 (patch)
tree747256d09cbd25088439cc99b1abc3416889df14 /errlog.c
parent705d47ac2c90b8de07a4ef3e1930de6c4b8fece0 (diff)
downloadefi-boot-shim-fc4368fed53837e00d303600d8b628cb0392b629.tar.gz
efi-boot-shim-fc4368fed53837e00d303600d8b628cb0392b629.zip
Improve debug output some
Signed-off-by: Peter Jones <pjones@redhat.com> Upstream: pr#213
Diffstat (limited to 'errlog.c')
-rw-r--r--errlog.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/errlog.c b/errlog.c
index 6669c800..08f7a82a 100644
--- a/errlog.c
+++ b/errlog.c
@@ -3,12 +3,28 @@
* Copyright 2017 Peter Jones <pjones@redhat.com>
*/
#include "shim.h"
+#include "hexdump.h"
static CHAR16 **errs = NULL;
static UINTN nerrs = 0;
EFI_STATUS
-VLogError(const char *file, int line, const char *func, CHAR16 *fmt, va_list args)
+vdprint_(const CHAR16 *fmt, const char *file, int line, const char *func, va_list args)
+{
+ va_list args2;
+ EFI_STATUS efi_status = EFI_SUCCESS;
+
+ if (verbose) {
+ va_copy(args2, args);
+ console_print(L"%a:%d:%a() ", file, line, func);
+ efi_status = VPrint(fmt, args2);
+ va_end(args2);
+ }
+ return efi_status;
+}
+
+EFI_STATUS
+VLogError(const char *file, int line, const char *func, const CHAR16 *fmt, va_list args)
{
va_list args2;
CHAR16 **newerrs;
@@ -35,7 +51,7 @@ VLogError(const char *file, int line, const char *func, CHAR16 *fmt, va_list arg
}
EFI_STATUS
-LogError_(const char *file, int line, const char *func, CHAR16 *fmt, ...)
+LogError_(const char *file, int line, const char *func, const CHAR16 *fmt, ...)
{
va_list args;
EFI_STATUS efi_status;
@@ -48,6 +64,12 @@ LogError_(const char *file, int line, const char *func, CHAR16 *fmt, ...)
}
VOID
+LogHexdump_(const char *file, int line, const char *func, const void *data, size_t sz)
+{
+ hexdumpat(file, line, func, data, sz, 0);
+}
+
+VOID
PrintErrors(VOID)
{
UINTN i;