1. What else is advised to be used to debug ebedded program instead?
First, if you have a JTAG or SWD or similar interface, use that with a source-level debugger.
Second, if you don't have that, there are various options:
1) Set/clear particular output pins as high/low, and look at them with a logic analyzer or oscilloscope.
2) Put in assertions around the code you suspect, and have the asserts stop and blink a LED when failing. Remove the assertions once you understand the problem.
3) Raw serial output, where you output a byte or two for the particular state you're interested in.
Another tip for embedded development: Never use malloc() or operator new.
Statically/globally allocate everything.
Only use stack (local) variables if they are 16 bytes or less.
Never use deep recursion.
For a software system with millions of lines of code, that would be terrible to maintain, but for systems where bytes matter (the AVR has 2 kilobytes total for all your variables and stacks!) then that's actually a much better way. Different tools for different situations!