Mercurial > hg > freeDiameter
changeset 1303:090390e89b1d
Fix --dbg-file and --dbg-function usage. However there is something weird on MacOS X still...
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Sun, 18 Oct 2015 12:00:36 +0800 |
parents | d8c998e7c535 |
children | 5a505af0bba0 |
files | freeDiameterd/main.c include/freeDiameter/libfdproto.h |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/freeDiameterd/main.c Sun Oct 18 11:25:28 2015 +0800 +++ b/freeDiameterd/main.c Sun Oct 18 12:00:36 2015 +0800 @@ -207,6 +207,7 @@ case 'f': /* Full debug for the function with this name. */ #ifdef DEBUG fd_debug_one_function = optarg; + fd_g_debug_lvl = FD_LOG_DEBUG; #else /* DEBUG */ fprintf(stderr, "Error: must compile with DEBUG support to use --dbg_func feature!\n"); return EINVAL; @@ -216,6 +217,7 @@ case 'F': /* Full debug for the file with this name. */ #ifdef DEBUG fd_debug_one_file = basename(optarg); + fd_g_debug_lvl = FD_LOG_DEBUG; #else /* DEBUG */ fprintf(stderr, "Error: must compile with DEBUG support to use --dbg_file feature!\n"); return EINVAL;
--- a/include/freeDiameter/libfdproto.h Sun Oct 18 11:25:28 2015 +0800 +++ b/include/freeDiameter/libfdproto.h Sun Oct 18 12:00:36 2015 +0800 @@ -289,7 +289,7 @@ #define __PRETTY_FUNCTION__ __func__ #endif /* __PRETTY_FUNCTION__ */ -/* A version of __FILE__ without the full path */ +/* A version of __FILE__ without the full path. This is specific to each C file being compiled */ static char * file_bname = NULL; static char * file_bname_init(char * full) { file_bname = basename(full); return file_bname; } #define __STRIPPED_FILE__ (file_bname ?: file_bname_init((char *)__FILE__))