Microcontroller reset
Your approach is unlikely to help. First, the reset may be totally unrelated to the current function: a watchdog timeout or a misconfigured ISR are common causes. Second, even if you discover the function which triggers the reset, there's no indication that this function is buggy. Perhaps a variable used by this function was trashed by a stack overflow which occurred somewhere else.

My advice is to strip down your firmware to the most basic core functionality and check if that part can run cleanly. Then you will include additional functions until the reset reappears, and search for errors in the function which was included last.

Also make sure you have plenty of stack space. If you have recursive functions, start by eliminating them or at least checking them scrupulously.

Since you mention you're using CAN, I suggest you check out XCP which can be used for error logging.