user3539: If the WDT ever fires, from the ISR I save some info in EEPROM for later diagnostics before I drive the reset pin. Stack size, heap size, etc.
It might also be useful to know where the code was when the WDT fired, i.e. the ISR's return address. How do I get that?

user4143: GCC has a handy function __builtin_return_address(depth) which should do what you want.  To get the return address of the current function (which should be the same whether it's a normal function or an ISR on AVR) you set the depth to 0:
void *addr = __builtin_return_address(0);

EDIT
The address returned above is a word address. Multiply by two to get a byte address as found in the disassembly from avr-objdump -SC firmware.elf >disassembled.txt
The latter is found at ~/.platformio/packages/toolchain-atmelavr/bin/avr-objdump

3539: <p>If the WDT ever fires, from the ISR I save some info in EEPROM for later diagnostics before I drive the reset pin. Stack size, heap size, etc.</p>
<p>It might also be useful to know where the code was when the WDT fired, i.e. the ISR's return address. How do I get that?</p>
 4143: <p>GCC has a handy function <code>__builtin_return_address(depth)</code> which should do what you want.  To get the return address of the current function (which should be the same whether it's a normal function or an ISR on AVR) you set the <code>depth</code> to 0:</p>
<pre class="lang-cpp prettyprint-override"><code>void *addr = __builtin_return_address(0);
</code></pre>
<p><strong>EDIT</strong></p>
<p>The address returned above is a word address. Multiply by two to get a byte address as found in the disassembly from <code>avr-objdump -SC firmware.elf &gt;disassembled.txt</code></p>
<p>The latter is found at <code>~/.platformio/packages/toolchain-atmelavr/bin/avr-objdump</code></p>
