1/** 2 @page debug Debugging 3 This page enumerates various techniques useful for debugging ISC DHCP software. 4 5 @section debugTips Debugging Tips & Tricks 6 7ISC DHCP code is somewhat convoluted. Due to extensive macros use, it is often 8difficult to even find whole function, much less to understand what they 9actually do. One way to find such a macro-defined function is to compile the 10code with debugging symbols (-g), load the binary into gdb and set a breakpoint 11for such a function. gdb will print out exact place in the code where the 12function is defined. Presumably one will find a macro at that specific location. 13For example to find where \ref lease_reference function is defined do: 14 15@verbatim 16gdb 17file dhcpd 18b lease_reference 19@endverbatim 20 21DEBUG_MEMORY_LEAKAGE may be defined in includes/site.h to enable some debugging 22code to help with debugging memory issues. This code keeps a running total 23of the outstanding memory that has been allocated and a list of the outstanding 24allocations. Both are updated whent he memory is freed. Status information is 25printed when do_packet() and do_packet6() complete processing. The outstanding 26value is expected to grow when new structures are used - for example when a new 27IPv6 lease is created. It is not expected to grow when a structure is reused 28for example when an IPv6 lease is renewed. 29 30DEBUG_RC_HISTORY and DEBUG_RC_HISTORY_EXHAUSTIVELY can also be defined to provide 31more verbose information about reference counts on objects. 32 33*/ 34