JTAG & Arduino mega

Is there a way to connect a JTAG probe for debugging on the Arduino Mega ?

Not from Arduino IDE. You can add some wires to a JTAG connector and use it with a JTAG debugger, but you are debugging pure assembler or C. You also need to activate the JTAG fuse, which will disable Analog In ports 4 to 7.

Great. So it should be simple to connect 4 wires to ADC4-7 and then set the jtag fuse. I need now to find out if the gnu gdb can serve as jtag debugger Thanks