Analyzing Memory Usage and Finding Memory Problems | Parent topic: Analyzing Memory Usage and Finding Memory Problems |
The memory-analyzing tools produce results that contain backtraces for allocations, corruption errors, and leaks. To display line numbers for shared libraries in these backtraces, the active tool must have access to library copies with debug symbols.
To find these debug symbols, the tools search the paths listed in the Libraries tab. When you add a library to a project, the IDE normally adds the path with the debug version of the library to the search list. It also adds the library file to the list of files to upload to the target, defined in the Upload tab. You can strip the debug information when uploading this fileāthe IDE just needs to find the debug symbols somewhere on the host when displaying the results.
If the automation fails, though, the user must manually specify where to find the right library files. The way to do this depends on the tool.
By default, the IDE starts a symbol server that the Valgrind tools use to gather debug information. The server runs on the host and searches the paths listed in the Libraries tab to provide symbol data to any tool upon request, which the tool uses to write the analysis results.
Ensure that the Start symbol server box is checked and the Server Port and Server Host fields are properly set.
You would change the port only if your host were running another service behind the default port of 1500. You would specify an IP address in that second field only if your host had multiple network interfaces and you wanted to use a specific one to communicate with the target.
You should now be able to analyze a program with a Valgrind tool and see error and memory information about any shared libraries with paths listed in the Libraries tab. If the symbol server still doesn't work, you have to upload the shared libraries to the target and specify their paths, as explained below.
In the Select symbols to be loaded on device field, add the paths of any libraries used by the application.
This field is auto-populated with the filenames of any user libraries needed by the executable binary. On the right, there are buttons for adding new library entries, editing the paths in existing entries, removing entries, and moving them in the list. You can uncheck entries, to prevent Valgrind from loading those particular symbols.