Help to debugging the server using GDb
Hi I was trying to debug the radiusd through gbb.But the program is exiting out below are the logs Pls let me know any debugging flags needs to be set, when i need to debug using GDB Rgds, Shankar ganesh Wed Aug 23 16:13:26 2006 : Info: Starting - reading configuration files ... n947 if ((mainconfig.allow_core_dumps == FALSE) && (debug_flag == 0)) { (gdb) n 959 DEBUG2("radiusd: entering modules setup"); (gdb) n 950 act.sa_handler = sig_fatal; (gdb) n 951 sigaction(SIGSEGV, &act, NULL); (gdb) n 959 DEBUG2("radiusd: entering modules setup"); (gdb) n 960 if (setup_modules() < 0) { (gdb) n n 971 if (strcmp(radlog_dir, "syslog") == 0) { (gdb) n 972 openlog(progname, LOG_PID, syslog_facility); (gdb) n 977 if (strcmp(radlog_dir, "stdout") == 0) { (gdb) n 978 radlog_dest = RADLOG_STDOUT; (gdb) n 979 } else if (strcmp(radlog_dir, "stderr") == 0) { (gdb) n 980 radlog_dest = RADLOG_STDERR; (gdb) n 984 rl_init(); (gdb) n 989 pair_builtincompare_init(); (gdb) n 998 if (debug_flag == 0 && dont_fork == FALSE) { (gdb) n 999 pid = fork(); (gdb) n 1000 if(pid < 0) { (gdb) n 1001 radlog(L_ERR|L_CONS, "Couldn't fork"); (gdb) n 1008 if(pid > 0) { (gdb) n 1009 exit(0); (gdb) n Program exited normally.
Shankar Ganesh C <shankarganesh@tataelxsi.co.in>wrote:
I was trying to debug the radiusd through gbb.But the program is exiting out below are the logs
The logs don't show a problem. Perhaps you could give more information about what the problem is. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
Alan DeKok wrote:
Shankar Ganesh C <shankarganesh@tataelxsi.co.in>wrote:
I was trying to debug the radiusd through gbb.But the program is exiting out below are the logs
The logs don't show a problem.
Perhaps you could give more information about what the problem is.
I'd guess Shankar just wanted to have radiusd stay in the foreground and not "daemonize" itself... That would be $ gdb /usr/local/bin/radiusd b <some function> run -X Or, which is usually better, let radiusd initialize itself such that all required modules and functions are loaded: $gdb /usr/local/bin/radiusd run -XA .... .... .... Listening on authentication *:1812 Listening on accounting *:1813 Ready to process requests. ^C (yes, Control-C) break <your entry function for debugging> cont and let your tests run. Michael
On August 23, 2006 11:49:34 PM +0200 Michael Joosten <michael.joosten@c-lab.de> wrote:
Or, which is usually better, let radiusd initialize itself such that all required modules and functions are loaded:
$gdb /usr/local/bin/radiusd run -XA .... .... .... Listening on authentication *:1812 Listening on accounting *:1813 Ready to process requests. ^C (yes, Control-C) break <your entry function for debugging>
You don't have to interrupt after modules are loaded if you are running a sufficiently recent gdb (6.2+ I think, maybe 6.1) which if a function is not found will defer setting the breakpoint until a shared library is loaded which contains that function; instead just set the breakpoint when you start gdb, like you normally would. Older gdb's have the option to break on shared library loads so you can set the breakpoints then. -frank
participants (4)
-
Alan DeKok -
Frank Cusack -
Michael Joosten -
Shankar Ganesh C