next up previous contents
Next: RSIM DEVELOPER'S GUIDE Up: Debugging Previous: Support for debugging RSIM

Debugging applications

RSIM does not currently include support for debugging application programs with a debugger like gdb or dbx, as RSIM does not expose information about the application being simulated to such a debugger. If RSIM encounters a nonrecoverable exception (such as a segmentation fault or bus error), all processors halt immediately and a termination message is printed on the standard error file. Application errors can be debugged either by running the applications natively on a machine using an ordinary debugger, or by running the application through RSIM instrumented with many printf calls. If the latter option is chosen, the debugging code should include an fflush(stdout) after each printf, as stdio streams are not guaranteed to be flushed on an abnormal exit in RSIM.

A common mistake in porting applications to RSIM is to forget the ``volatile'' declaration for shared synchronization variables. This is important for avoiding compiler optimizations that may cause infinite loops.



Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997