CVS: examples/stackcheck README.txt,1.1,1.2
Chris Liechti <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/examples/stackcheck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1695/examples/stackcheck Modified Files: README.txt Log Message: - consistently name the files README.txt (with extension for the windows users) - update some of the readmes contents and add new ones - use the reStructuredText format for use with docutils rst2html Index: README.txt =================================================================== RCS file: /cvsroot/mspgcc/examples/stackcheck/README.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -d -r1.1 -r1.2 --- README.txt 10 Jun 2004 00:57:53 -0000 1.1 +++ README.txt 26 Dec 2005 20:37:03 -0000 1.2 @@ -1,21 +1,24 @@ -whats this? ------------ -It's a simple example project for the MSP430 series MCU and the GCC port -of the mspgcc project. The project contains a makefile and uses assembler -and C sources. It demonstrates a way to detect stack overflows and how to +stackcheck +========== + +Overview +-------- +This is a example project for the MSP430 series MCU and the GCC port of the +mspgcc project. The project contains a makefile and C sources. +It demonstrates a way to detect stack overflows and how to fill unused RAM so that max stack usage can be seen. -This example shows the following features: +Features: - stack overflow detection - use of segment addresses - - resiter variable in given register +- register variable in given register The idea is to run this example in the debugger, look at the RAM contents right after starting it (RAM should be all 0). Then single step down to -stackProtectionInit(), step over that function call. The RAM is now filled -with 0x5aa5. Set a breakpoint on the line "WDTCTL = 0;" in stackCheck() and -run the program (with "continue") until it hits that breakpoint. The +``stackProtectionInit()``, step over that function call. The RAM is now filled +with 0x5aa5. Set a breakpoint on the line ``WDTCTL = 0;`` in ``stackCheck()`` +and run the program (with ``continue``) until it hits that breakpoint. The RAM is now filled up with return addresses of the last run. The example just runs until it hits the stackGuard. With small modifications @@ -23,9 +26,22 @@ free memory are overwritten, which can be used to check how large the stack grew at maximum. -disclaimer +.. note:: + + There is no guaratee that this stack check detects a stack overflow! + + As the ``stackCheck()`` function is only called from time to time, + a stack overflow could have overwritten variables or worse, modifications + to variables overwrite values on the stack, like return addresses. The + CPU then starts executing random code, before the ``stackCheck()`` can + be called again. + + +Disclaimer ---------- -This example is part of the mspgcc project http://mspgcc.sf.net -see license.txt for details. +This example is part of the mspgcc project http://mspgcc.sf.net. +See license.txt_ for details. chris \ No newline at end of file + +.. _license.txt: ../license.html ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click