# HG changeset patch # User Matt Johnston # Date 1648104253 -28800 # Node ID be236878efcfdfcfd46645aa44b13d142f6cc86c # Parent 9382271da9ef734483b6c06625a9cf61f0130752 Add -v variable debug levels for server too -vvvv is equivalent to the old -v diff -r 9382271da9ef -r be236878efcf debug.h --- a/debug.h Thu Mar 24 14:18:45 2022 +0800 +++ b/debug.h Thu Mar 24 14:44:13 2022 +0800 @@ -48,6 +48,8 @@ /*#define DEBUG_KEXHASH*/ /*#define DEBUG_RSA*/ +/* The level of TRACE() statements */ +#define DROPBEAR_VERBOSE_LEVEL 4 #if DEBUG_TRACE extern int debug_trace; diff -r 9382271da9ef -r be236878efcf dropbearconvert.c --- a/dropbearconvert.c Thu Mar 24 14:18:45 2022 +0800 +++ b/dropbearconvert.c Thu Mar 24 14:44:13 2022 +0800 @@ -69,7 +69,7 @@ #if DEBUG_TRACE /* It's hard for it to get in the way _too_ much */ - debug_trace = 1; + debug_trace = DROPBEAR_VERBOSE_LEVEL; #endif /* get the commandline options */ diff -r 9382271da9ef -r be236878efcf dropbearkey.c --- a/dropbearkey.c Thu Mar 24 14:18:45 2022 +0800 +++ b/dropbearkey.c Thu Mar 24 14:44:13 2022 +0800 @@ -195,7 +195,7 @@ break; #if DEBUG_TRACE case 'v': - debug_trace = 1; + debug_trace = DROPBEAR_VERBOSE_LEVEL; break; #endif default: diff -r 9382271da9ef -r be236878efcf fuzz/fuzz-harness.c --- a/fuzz/fuzz-harness.c Thu Mar 24 14:18:45 2022 +0800 +++ b/fuzz/fuzz-harness.c Thu Mar 24 14:44:13 2022 +0800 @@ -12,8 +12,8 @@ for (i = 1; i < argc; i++) { #if DEBUG_TRACE if (strcmp(argv[i], "-v") == 0) { - debug_trace = 1; - TRACE(("debug printing on")) + debug_trace++; + fprintf(stderr, "debug level -> %d\n", debug_trace); } #endif if (strcmp(argv[i], "-q") == 0) { diff -r 9382271da9ef -r be236878efcf svr-runopts.c --- a/svr-runopts.c Thu Mar 24 14:18:45 2022 +0800 +++ b/svr-runopts.c Thu Mar 24 14:44:13 2022 +0800 @@ -109,7 +109,7 @@ #endif "-V Version\n" #if DEBUG_TRACE - "-v verbose (compiled with DEBUG_TRACE)\n" + "-v verbose (repeat for more verbose)\n" #endif ,DROPBEAR_VERSION, progname, #if DROPBEAR_DSS @@ -310,7 +310,7 @@ #endif #if DEBUG_TRACE case 'v': - debug_trace = 1; + debug_trace++; break; #endif case 'V':