$function
Version information
Introduced in version v0.1
This macro is considered stable
About
The $function macro allows v5dbg to generate a backtrace to determine the current point of execution. When placed at the top of a function it adds debug information to the current backtrace, when the function exits its then removed.
Why do I need to use this macro?
Unlike traditional debuggers which can ask the operating system for a backtrace and can then convert the returned addresses into symbol names, v5dbg runs on an environment where this is not possible (yet).
As a workaround $function traces where it was called from to determine the proper line of execution.
Notes
Required environment
- This macro requires the debug server to have been initialized before being called.
- This macro requires the current thread to be supervised with $ntask or
V5Dbg_Init
Examples
- For more information on
$ntasklook here - Now opcontrol will be the first item in the callstack since it's the first time
$functionwas called on this thread/task.
- For more information on
$ntasklook here - Now our
printAndSleepfunction will be the second item in the callstack, it should now look like this:void printAndSleep(const std::string &p)void opcontrol()