Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>No, and Yes*.</p> <p>No: As another commenter said, Valgrind does not run on 8051 architectures, so you can't use Valgrind as you would on an x86 system.</p> <p>Yes*: (the asterisk (*) is because it's a limited "yes")</p> <p>But you can use Valgrind on the non-8051/IAR-specific parts of your code if you:</p> <ol> <li>Separate the 8051-specific and IAR-specific code from the architecture/compiler agnostic code. <ul> <li>You'll probably want to do this so the code doesn't get any bigger as a result of separating the agnostic code. (I'm assuming code size is at a premium since you're working on an 8051.)</li> </ul></li> <li>Compile the architecture/compiler agnostic code with gcc and run it using Valgrind on your desktop/laptop development machine, which is probably an x86 machine. <ul> <li>Of course you can use any other Valgrind-supported architecture/compiler, x86/gcc isn't your only choice.</li> </ul></li> </ol> <p>This way Valgrind will be able to check some of your code, which is better than nothing.</p> <p>And separating the compiler/chip specific parts of your code will also make it more portable and reusable.</p> <p>Oh, and this isn't directly related, but you should also consider using a static analysis program like PC-Lint: <a href="http://www.gimpel.com/html/index.htm" rel="nofollow">http://www.gimpel.com/html/index.htm</a></p> <p>It checks some things that Valgrind checks, and many things that Valgrind doesn't check. Plus it will check <em>all</em> of your code, not just the non-8051/IAR code.</p> <p>There are plenty of similar tools out there; PC-Lint is the most popular that I've seen.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload