diff --git a/agent/agent.h b/agent/agent.h index 2dfbf5cee..89dc46d05 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -168,7 +168,6 @@ struct /* Bit values for the --debug option. */ -#define DBG_COMMAND_VALUE 1 /* debug commands i/o */ #define DBG_MPI_VALUE 2 /* debug mpi details */ #define DBG_CRYPTO_VALUE 4 /* debug low level crypto */ #define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */ @@ -178,7 +177,6 @@ struct #define DBG_IPC_VALUE 1024 /* Enable Assuan debugging. */ /* Test macros for the debug option. */ -#define DBG_COMMAND (opt.debug & DBG_COMMAND_VALUE) #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 5e2e4bfd7..f4ed6c5c4 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -251,7 +251,6 @@ static ARGPARSE_OPTS opts[] = { /* The list of supported debug flags. */ static struct debug_flags_s debug_flags [] = { - { DBG_COMMAND_VALUE, "command" }, { DBG_MPI_VALUE , "mpi" }, { DBG_CRYPTO_VALUE , "crypto" }, { DBG_MEMORY_VALUE , "memory" }, @@ -520,10 +519,9 @@ set_debug (void) else if (!strcmp (debug_level, "basic") || (numok && numlvl <= 2)) opt.debug = DBG_IPC_VALUE; else if (!strcmp (debug_level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_IPC_VALUE|DBG_COMMAND_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (debug_level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_IPC_VALUE|DBG_COMMAND_VALUE - |DBG_CACHE_VALUE); + opt.debug = (DBG_IPC_VALUE | DBG_CACHE_VALUE); else if (!strcmp (debug_level, "guru") || numok) { opt.debug = ~0; diff --git a/common/miscellaneous.c b/common/miscellaneous.c index 992494332..c9889750b 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -480,6 +480,8 @@ gnupg_compare_version (const char *a, const char *b) * supplied variable is updated by the parsed flags. * * If STRING is NULL the enabled debug flags are printed. + * + * See doc/DETAILS for a summary of used debug options. */ int parse_debug_flag (const char *string, unsigned int *debugvar, diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index ef30d2c3c..0d896f1ef 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -257,6 +257,8 @@ static struct debug_flags_s debug_flags [] = { DBG_MEMSTAT_VALUE, "memstat" }, { DBG_HASHING_VALUE, "hashing" }, { DBG_IPC_VALUE , "ipc" }, + { DBG_DNS_VALUE , "dns" }, + { DBG_NETWORK_VALUE, "network" }, { DBG_LOOKUP_VALUE , "lookup" }, { 77, NULL } /* 77 := Do not exit on "help" or "?". */ }; diff --git a/dirmngr/dirmngr.h b/dirmngr/dirmngr.h index da1c4beff..9a8787842 100644 --- a/dirmngr/dirmngr.h +++ b/dirmngr/dirmngr.h @@ -136,19 +136,23 @@ struct #define DBG_X509_VALUE 1 /* debug x.509 parsing */ #define DBG_CRYPTO_VALUE 4 /* debug low level crypto */ +#define DBG_DNS_VALUE 16 /* debug DNS calls. */ #define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */ #define DBG_CACHE_VALUE 64 /* debug the caching */ #define DBG_MEMSTAT_VALUE 128 /* show memory statistics */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ #define DBG_IPC_VALUE 1024 /* debug assuan communication */ +#define DBG_NETWORK_VALUE 2048 /* debug network I/O. */ #define DBG_LOOKUP_VALUE 8192 /* debug lookup details */ #define DBG_X509 (opt.debug & DBG_X509_VALUE) #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) +#define DBG_DNS (opt.debug & DBG_DNS_VALUE) #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) #define DBG_IPC (opt.debug & DBG_IPC_VALUE) +#define DBG_NETWORK (opt.debug & DBG_NETWORK_VALUE) #define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE) /* A simple list of certificate references. */ diff --git a/doc/DETAILS b/doc/DETAILS index 00b55c51b..568500e51 100644 --- a/doc/DETAILS +++ b/doc/DETAILS @@ -1328,6 +1328,43 @@ Status codes are: +* Debug flags + +This tables gives the flag values for the --debug option along with +the alternative names used by the components. + +| | gpg | gpgsm | agent | scd | dirmngr | g13 | wks | +|-------+---------+---------+---------+---------+---------+---------+---------| +| 1 | packet | x509 | | | x509 | mount | mime | +| 2 | mpi | mpi | mpi | mpi | | | parser | +| 4 | crypto | crypto | crypto | crypto | crypto | crypto | crypto | +| 8 | filter | | | | | | | +| 16 | iobuf | | | | dns | | | +| 32 | memory | memory | memory | memory | memory | memory | memory | +| 64 | cache | cache | cache | cache | cache | | | +| 128 | memstat | memstat | memstat | memstat | memstat | memstat | memstat | +| 256 | trust | | | | | | | +| 512 | hashing | hashing | hashing | hashing | hashing | | | +| 1024 | ipc | ipc | ipc | ipc | ipc | ipc | ipc | +| 2048 | | | | cardio | network | | | +| 4096 | clock | | | reader | | | | +| 8192 | lookup | | | | lookup | | | +| 16384 | extprog | | | | | | extprog | + +Description of some debug flags: + + - cardio :: Used by scdaemon to trace the APDUs exchange with the + card. + - clock :: Show execution times of certain functions. + - crypto :: Trace crypto operations. + - hashing :: Create files with the hashed data. + - ipc :: Trace the Assuan commands. + - mpi :: Show the values of the MPIs. + - reader :: Used by scdaemon to trace card reader related code. For + example: Open and close reader. + + + * Miscellaneous notes ** v3 fingerprints diff --git a/g10/gpg.c b/g10/gpg.c index a8f731b02..8c5b50589 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -913,7 +913,6 @@ static struct debug_flags_s debug_flags [] = { DBG_MEMSTAT_VALUE, "memstat" }, { DBG_TRUST_VALUE , "trust" }, { DBG_HASHING_VALUE, "hashing" }, - { DBG_CARD_IO_VALUE, "cardio" }, { DBG_IPC_VALUE , "ipc" }, { DBG_CLOCK_VALUE , "clock" }, { DBG_LOOKUP_VALUE , "lookup" }, diff --git a/g10/options.h b/g10/options.h index 2449042f5..589b68e1e 100644 --- a/g10/options.h +++ b/g10/options.h @@ -300,7 +300,6 @@ struct { #define DBG_TRUST_VALUE 256 /* debug the trustdb */ #define DBG_HASHING_VALUE 512 /* debug hashing operations */ #define DBG_IPC_VALUE 1024 /* debug assuan communication */ -#define DBG_CARD_IO_VALUE 2048 /* debug smart card I/O. */ #define DBG_CLOCK_VALUE 4096 #define DBG_LOOKUP_VALUE 8192 /* debug the key lookup */ #define DBG_EXTPROG_VALUE 16384 /* debug external program calls */ @@ -314,7 +313,6 @@ struct { #define DBG_TRUST (opt.debug & DBG_TRUST_VALUE) #define DBG_HASHING (opt.debug & DBG_HASHING_VALUE) #define DBG_IPC (opt.debug & DBG_IPC_VALUE) -#define DBG_CARD_IO (opt.debug & DBG_CARD_IO_VALUE) #define DBG_IPC (opt.debug & DBG_IPC_VALUE) #define DBG_CLOCK (opt.debug & DBG_CLOCK_VALUE) #define DBG_LOOKUP (opt.debug & DBG_LOOKUP_VALUE) diff --git a/scd/scdaemon.c b/scd/scdaemon.c index 064cae9cb..38e3c40c4 100644 --- a/scd/scdaemon.c +++ b/scd/scdaemon.c @@ -165,7 +165,6 @@ static ARGPARSE_OPTS opts[] = { /* The list of supported debug flags. */ static struct debug_flags_s debug_flags [] = { - { DBG_COMMAND_VALUE, "command" }, { DBG_MPI_VALUE , "mpi" }, { DBG_CRYPTO_VALUE , "crypto" }, { DBG_MEMORY_VALUE , "memory" }, @@ -328,10 +327,9 @@ set_debug (const char *level) else if (!strcmp (level, "basic") || (numok && numlvl <= 2)) opt.debug = DBG_IPC_VALUE; else if (!strcmp (level, "advanced") || (numok && numlvl <= 5)) - opt.debug = DBG_IPC_VALUE|DBG_COMMAND_VALUE; + opt.debug = DBG_IPC_VALUE; else if (!strcmp (level, "expert") || (numok && numlvl <= 8)) - opt.debug = (DBG_IPC_VALUE|DBG_COMMAND_VALUE - |DBG_CACHE_VALUE|DBG_CARD_IO_VALUE); + opt.debug = (DBG_IPC_VALUE|DBG_CACHE_VALUE|DBG_CARD_IO_VALUE); else if (!strcmp (level, "guru") || numok) { opt.debug = ~0; diff --git a/scd/scdaemon.h b/scd/scdaemon.h index 31e9c791c..38aa4905b 100644 --- a/scd/scdaemon.h +++ b/scd/scdaemon.h @@ -65,7 +65,6 @@ struct } opt; -#define DBG_COMMAND_VALUE 1 /* debug commands i/o */ #define DBG_MPI_VALUE 2 /* debug mpi details */ #define DBG_CRYPTO_VALUE 4 /* debug low level crypto */ #define DBG_MEMORY_VALUE 32 /* debug memory allocation stuff */ @@ -76,7 +75,6 @@ struct #define DBG_CARD_IO_VALUE 2048 #define DBG_READER_VALUE 4096 /* Trace reader related functions. */ -#define DBG_COMMAND (opt.debug & DBG_COMMAND_VALUE) #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE) #define DBG_MEMORY (opt.debug & DBG_MEMORY_VALUE) #define DBG_CACHE (opt.debug & DBG_CACHE_VALUE)