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