mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 12:03:55 +01:00
Removed debugging statements.
This commit is contained in:
26
src/debug_helpers.c
Normal file
26
src/debug_helpers.c
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Convert a string to its hexadecimal representation.
|
||||
*
|
||||
* Use like this:
|
||||
* log_write(0, LOG_MAIN, "DEBUG: %s", string2hex(var, var_len));
|
||||
*/
|
||||
char * string2hex(unsigned char * input, size_t length) {
|
||||
const int growth = 3;
|
||||
char * outstring = store_get(growth*length+1);
|
||||
memset(outstring, 0, 3*length+1);
|
||||
for (int i =0; i<length; i++) {
|
||||
sprintf(outstring+i*growth, "%02x ", input[i]);
|
||||
}
|
||||
return outstring;
|
||||
}
|
||||
|
||||
/*
|
||||
* How to debug this library:
|
||||
*
|
||||
* 1. Add this code to the first “breakpoint”:
|
||||
* log_write(0, LOG_MAIN, "pid: %d", getpid()); int busywait = 0; while (busywait == 0) {}
|
||||
* 2. Compile.
|
||||
* 3. Run “exim -be […]” to call the lib; see simple_exim_test.sh for details.
|
||||
* 4. Read exim pid from log output. Attach to the looping exim process with “gdb -p PID”
|
||||
* 5. Prepare breakpoints, watches, etc. Set busywait to 1 and continue.
|
||||
*/
|
||||
Reference in New Issue
Block a user