Running memory-analyzing tools from the command line

You can run the same tool used by Memory Analysis as well as any Valgrind tool from the command line, outside of QNX Momentics IDE. This is handy for analyzing applications during system startup or when there's no network connection to the target.

Your command line must load any shared libraries required by the application being analyzed and set any environment variables and options required by the analysis tool or the application.

Running an application with librcheck

The Memory Analysis tool in the IDE displays the data produced by the debug allocation library, librcheck, which is implemented separately from the tool. For an example of using the command line to launch an application with librcheck loaded, see the Using the librcheck library section in the Programmer's Guide.

To view the memory data generated by librcheck, you must either attach the Memory Analysis tool to one of the application's processes or wait until the application exits and then copy the trace file from the target to the host and import it into the IDE. Although the trace file is text-based, its contents are too cryptic to read manually; the IDE is the only practical way to view librcheck data.

Running a Valgrind tool on an application

You can issue a command that tells Valgrind to run Massif, Memcheck, or Helgrind on the specified application with certain options and environment variables. For examples of such command lines, see the valgrind entry in the Utilities Reference.

Valgrind produces a log file when it finishes executing the program. To see the analysis results, you must copy the log file from the target to the host, then import it into the IDE. Although the log file is somewhat readable, we recommend viewing the results in the IDE because it presents them in a more readable way and lets you navigate to the related source code.