Request for Comments: Debug Trace Options

This RFC is regarding adding options to debug_backtrace() and debug_print_backtrace()


Debug backtrace functions are a very useful debug tool. However, for big projects, the problem that often happens is that when something happens inside the code, the debug trace becomes so big it's unmanageable. This is because it always includes the arguments, and those can be complex data arrays, huge objects, etc. so when the trace is prepared or printed out, the useful information is drowned in the mass of white noise.


Change the signature of both debug_backtrace() and debug_print_backtrace() to introduce options parameter. This parameter will be a bitmask, currently supporting these values:

Constant Value Means
DEBUG_BACKTRACE_PROVIDE_OBJECT 1 Objects are included in trace for debug_backtrace()
DEBUG_BACKTRACE_IGNORE_ARGS 2 Arguments are not included in the backtrace for both functions

The default options will be DEBUG_BACKTRACE_PROVIDE_OBJECT, which agrees with current functionality for both functions.

rfc/debugoptions.txt · Last modified: 2017/09/22 13:28 (external edit)