An Arduino-based debugWIRE debugger: dw-link
You want to debug your Arduino project on an ATmega328P or on a classic ATtiny? For this purpose, you need a hardware debugger. If you do not own such a hardware debugger but would like to try debugging your Arduino project on the chip nevertheless, then dw-link is the right thing for you. It turns an Arduino UNO into a hardware debugger. It can be used stand-alone (using the symbolic debugger AVR-GDB in a console window), or you can use it as part of the Arduino IDE 2 or other IDEs. Check out the quickstart guides!
If you are looking for a more durable debugging solution, I recommend MPLAB SNAP (or any other EDBG-based Microchip debugger). When employing the GDB server PyAvrOCD (perhaps implicitly by using the Arduino IDE 2), SNAP is a drop-in replacement for dw-link, and it can do much more than dw-link.