I am researching about Arduino Platform, and I want to ask you if it is possible to debug memory positions (Stack, Heap...) and registers (EIP,SP...) of the Arduino Part (ATmega 32u4) in Arduino Yun.
I mean, is it possible to do it in Arduino something like in Windows debugging with Immunity Debugger/WinDBG or like in Linux with gdb?
It does not matter if it can do in real time or simulated.
It can be done, but not through the Arduino IDE. There may be other solutions out there, but the most straight forward seems to be using Atmel's AVR Studio IDE and an external programmer pod that supports thevDebugWire protocol.
It will, of course, be somewhat different than using the Arduino IDE, and you will lose some of the hand-holding that the Arduino IDE does for you, like pre-processing the .ino file into true C++ and creating the main() function for you.
I've read many times that hardware debugging is stuff for 32 bits processors, not worth for 8 bit ones, they are fine with Serial print statements.
If you want hardware debugging of an 8 bit microprocesor atmega32U4, the closest thing you have is Atmel AVR Studio with Debugwire. That is not going to run inside your Arduino Yun, if that's what you are planning.
And by the closest thing I mean Debugwire isn't as powerfull as JTAG, it's slow and I guess it's not real hardware debugging and supports few breakpoints.
If you want to go through memory, registers and stuff you better use Arduino Zero with it's embedded debugger (EDBG), or cheaper, Maple mini with OpenOCD + GDB + JTAG.
Hardware debugging usefulness isn't limited to 32 bit processors, there are still valid reasons to want to do it with an 8-bit processor. Serial print statements are useful for rudimentary debugging, but are far from an ideal solution. 32-bit processors are all the rage right now, and there is good reason for it, but 8-bit processors are not dead - they have distinct advantages in size, cost, and ease of use and are still very applicable when the extra capacity and speed of a more advanced processor are not needed.
Sure, debugging an 8-bit processor with a serial connection is not going to be as fast as a JTAG or dedicated debug chip on a 32-bit processor, but that doesn't mean that it's not usable. An 8-bit processor, on a development board like an Arduino, with a DebugWire connection to AVR Studio gives a tremendous debugging advantage over Serial print statements. And it also serves as a great learning tool to be able to step through the code, inspect registers and variables, and see what the code is actually doing.
mart256:
If you want to go through memory, registers and stuff you better use Arduino Zero with it's embedded debugger (EDBG), or cheaper, Maple mini with OpenOCD + GDB + JTAG.
There really isn't a need to go to that advanced level just to get better debugging than a Print statement. If your application needs the extra power, go for it, but there are lots of projects out there that aren't even stressing an 8-bit processor, so the more advanced boards are often overkill.
You don't always need a Lamborghini, often times a bicycle can have the advantage.
You are rigth Shape, but I've another personal reason why I wouldnt go for the debugwire option, which I didnt mention before.
For debugwire you need atmel debugwire programmers and they are expensive.
There is the avr dragon that is somewhat cheaper, but its easy to brick (I burnt one myself and still dont know how).
And the second point is, sometimes lamborginis are overkill but are as cheap as a bicicle (maple mini is very cheap).
Thats why Id go for jtag or similar, jtag clones are cheap, compatible with ocd which is free and more flexible than atmel studio (dont know if better although).
You make valid points. But even if some Lamborghini's are cheap, they are still different and have their own learning curve needed to become familiar with their strengths and weaknesses, and the need to learn a new toolset. Of course, to use the hardware debugging on even a familiar processor family still requires learning a new toolset.
My main point was to counter the the general feeling that 8-bit processors have no relevance given the current proliferation of 32 bit processors. Each processor family still has a meaningful place in the world. The right choice for an application depends on many factors.