where was the machine interrupted

Hello,

My watchdog is set to interrupt (few times before resetting) as a timing extension, Can I put in that ISR a mean to know what was the machine doing when interrupted by the WD?

Thanks for your help

https://www.avrfreaks.net/forum/solved-doing-offline-stack-trace?skey=stack%20trace

I just found it. I didn't try it out

Starting with the brut force approach: I inserted before every function call in my 'loop' as well as at the entry point of all other functions the code

trace=__LINE__;

where trace is global and in the wd isr's I inserted a call to my logger to put the trace in eeprom