When we simulate (VHDL) RTL designs in a simulation tool like ModelSim or ActiveHDL e.t.c, we can have a complete visibility of all signals and variables in the design. This goes a great deal in aiding debug in simulation. Certain things like function calls and procedure calls are not easy to debug though, we would have to set breakpoints for that.
Now assume I have a soft-processor inside the design like a Nios II processor or something else which has a program written in high level language. This program will have its own variables and state-machine code implemented in a high level programming language like C. If I carry out RTL simulation, I would be able to see what is happening at the interface of the processor. However, if I want to be able to debug the system, I should be able to see into the software of the processor in real-time as the simulation progresses.
How is this problem handled in the real world? How would such systems be debugged? If I want to fix an error in the code, I would have to have a command-line method to compile the code, generate hex and put it in a place where the simulation tool can access it everytime.