Arduinos and RepRap controllers generally don't use JTAG. On how to upload bootloaders: [
reprap.org] A fuse calculator to find out how to change fuses to enable JTAG: [
www.engbedded.com] From there on you likely have to resort to Atmel documentation on how to make use of this JTAG.
Hint: Teacup developers use a cycle-accurate simulator instead. Much easier, as you can pause the CPU clock and also investigate many I/O pins at the same time: [
reprap.org] Similarly powerful hardware equipments exist, but they're quite costly and complicated. The only thing not working in the simulator is double-speed serial (would require a fix in SimulAVR), so you're limited to about 38400 baud. Not really a limitation for debugging.