Even the Arduino hardware has to be hacked to make it debugable
Ok, seems that "arduino" can be considered as either "arduino programming environment" or "arduino hardware" , one of zeveral PCBs sold under this brand, namely arduino uno, due, mini, micro whatever.
Some notes:
-OP's code does not look like the one from arduino programming environment - it is a plain C, possibly from avr-gcc. GCC can generate elf with debugging infrornation without a problem, it is just that OP deliberately punishes himself by dumping the output.
-One cannot debug ATMega8 at all as this and many other AVR8s (attiny4) do not have OCD.
-AVR8's with dW debugging interface (mostly tinies, U2 etc) require proprietary debugging dongles (sold by Atmel)
-AVR8's with proper JTAG (most megas, AT90, U4, U7 etc) work with proprietary atmel dongles but also (some) work with JTAGICEMk1 clones (raw atmega16)
That is why I suggest OP should get some dongle (proprietary atmel or raw atmega16) and a proper AVR8 with JTAG (atmega16, atmega32, atmega128) instead of dicking around with atmega8.