comparison debug.h @ 1899:ab9c5467970d

Merge pull request #152 from HansH111/tracelevel2
author Matt Johnston <matt@ucc.asn.au>
date Wed, 23 Mar 2022 21:55:33 +0800
parents 3f87f7ff1092
children be236878efcf
comparison
equal deleted inserted replaced
1890:45e552ee4391 1899:ab9c5467970d
46 /* A couple of flags, not usually useful, and mightn't do anything */ 46 /* A couple of flags, not usually useful, and mightn't do anything */
47 47
48 /*#define DEBUG_KEXHASH*/ 48 /*#define DEBUG_KEXHASH*/
49 /*#define DEBUG_RSA*/ 49 /*#define DEBUG_RSA*/
50 50
51 /* you don't need to touch this block */ 51
52 #if DEBUG_TRACE 52 #if DEBUG_TRACE
53 extern int debug_trace; 53 extern int debug_trace;
54 #define TRACE(X) dropbear_trace X; 54 #endif
55 #define TRACE2(X) dropbear_trace2 X; 55
56 #else /*DEBUG_TRACE*/ 56 /* Enable debug trace levels.
57 We can't use __VA_ARGS_ here because Dropbear supports
58 old ~C89 compilers */
59 /* Default is to discard output ... */
60 #define DEBUG1(X)
61 #define DEBUG2(X)
62 #define DEBUG3(X)
57 #define TRACE(X) 63 #define TRACE(X)
58 #define TRACE2(X) 64 #define TRACE2(X)
59 #endif /*DEBUG_TRACE*/ 65 /* ... unless DEBUG_TRACE is high enough */
66 #if (DEBUG_TRACE>=1)
67 #undef DEBUG1
68 #define DEBUG1(X) dropbear_trace1 X;
69 #endif
70 #if (DEBUG_TRACE>=2)
71 #undef DEBUG2
72 #define DEBUG2(X) dropbear_trace2 X;
73 #endif
74 #if (DEBUG_TRACE>=3)
75 #undef DEBUG3
76 #define DEBUG3(X) dropbear_trace3 X;
77 #endif
78 #if (DEBUG_TRACE>=4)
79 #undef TRACE
80 #define TRACE(X) dropbear_trace4 X;
81 #endif
82 #if (DEBUG_TRACE>=5)
83 #undef TRACE2
84 #define TRACE2(X) dropbear_trace5 X;
85 #endif
60 86
61 /* To debug with GDB it is easier to run with no forking of child processes. 87 /* To debug with GDB it is easier to run with no forking of child processes.
62 You will need to pass "-F" as well. */ 88 You will need to pass "-F" as well. */
63 #ifndef DEBUG_NOFORK 89 #ifndef DEBUG_NOFORK
64 #define DEBUG_NOFORK 0 90 #define DEBUG_NOFORK 0