aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-07-08 16:23:45 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-07-08 16:23:45 +0100
commit3aa295d25bda39afee12b015523f222ce7940079 (patch)
tree8219b4d91f53e09d1f375547595d611065e45976 /com32/modules
parent8eefc0dad8fe2c01b0d90d36f1cea8de8ac4d514 (diff)
parent89794a3d0b8659e2a143faeffc77877b45754c52 (diff)
downloadsyslinux-3aa295d25bda39afee12b015523f222ce7940079.tar.gz
syslinux-3aa295d25bda39afee12b015523f222ce7940079.tar.xz
syslinux-3aa295d25bda39afee12b015523f222ce7940079.zip
Merge tag 'syslinux-5.11-pre8' into firmwaresyslinux-6.02-pre1
syslinux-5.11-pre8 Conflicts: NEWS com32/lib/Makefile core/conio.c mk/devel.mk mk/elf.mk
Diffstat (limited to 'com32/modules')
-rw-r--r--com32/modules/Makefile2
-rw-r--r--com32/modules/debug.c54
-rw-r--r--com32/modules/prdhcp.c4
3 files changed, 57 insertions, 3 deletions
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 6e562b8c..13cc63bb 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -24,7 +24,7 @@ MODULES = config.c32 ethersel.c32 dmitest.c32 cpuidtest.c32 \
kbdmap.c32 cmd.c32 vpdtest.c32 host.c32 ls.c32 gpxecmd.c32 \
ifcpu.c32 cpuid.c32 cat.c32 pwd.c32 ifplop.c32 zzjson.c32 \
whichsys.c32 prdhcp.c32 pxechn.c32 kontron_wdt.c32 ifmemdsk.c32 \
- hexdump.c32 poweroff.c32 cptime.c32
+ hexdump.c32 poweroff.c32 cptime.c32 debug.c32
TESTFILES =
diff --git a/com32/modules/debug.c b/com32/modules/debug.c
new file mode 100644
index 00000000..1026ebf3
--- /dev/null
+++ b/com32/modules/debug.c
@@ -0,0 +1,54 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * Copyright 2013 Intel Corporation; author: Matt Fleming
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston MA 02110-1301, USA; either version 2 of the License, or
+ * (at your option) any later version; incorporated herein by reference.
+ *
+ * ----------------------------------------------------------------------- */
+
+#include <syslinux/debug.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *progname;
+
+static void usage(void)
+{
+ fprintf(stderr, "Usage: %s [-e|-d] <func1> [<func2>, ...]\n", progname);
+}
+
+int main(int argc, char *argv[])
+{
+ bool enable;
+ int i;
+
+ progname = argv[0];
+
+ if (argc < 3) {
+ usage();
+ return -1;
+ }
+
+ if (!strncmp(argv[1], "-e", 2))
+ enable = true;
+ else if (!strncmp(argv[1], "-d", 2))
+ enable = false;
+ else {
+ usage();
+ return -1;
+ }
+
+ for (i = 2; i < argc; i++) {
+ char *str = argv[i];
+
+ if (syslinux_debug(str, enable) < 0)
+ fprintf(stderr, "Failed to debug symbol \"%s\"\n", str);
+ }
+
+ return 0;
+}
diff --git a/com32/modules/prdhcp.c b/com32/modules/prdhcp.c
index e1785a03..4ae295e8 100644
--- a/com32/modules/prdhcp.c
+++ b/com32/modules/prdhcp.c
@@ -39,11 +39,11 @@
#include <unistd.h>
#include <getkey.h>
-#define DEBUG 0
+#define PRDHCP_DEBUG 0
#define dprintf0(f, ...) ((void)0)
-#ifdef DEBUG
+#ifdef PRDHCP_DEBUG
# define dpressanykey pressanykey
# define dprintf printf
# define dprint_pxe_bootp_t print_pxe_bootp_t