Add a basic stack-tracking mechanism for easier debugging.