De-mangled C++ symbol names may contain spaces, so the function
name reader must not split around these spaces.
Also mention in the documentation that 'nm --demangle' can be used
to get readable C++ function names.
Refs bug #459534.
Change-Id: Ib046a15ada590b389bb8d1af2983e00629d17a35
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/41561
Reviewed-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
** <pre>nm myprogram > mapping.txt</pre>
* Click the '''Import Mapping File''' ([[Image:images/import.gif]]) button in the Callstack View, and select the ''mapping.txt'' file that was just created.
+(If you are dealing with C++ executables, you may want to use ''nm --demangle'' instead to get readable function names.)
+
The view should now update to display the function names instead. Make sure the binary used for taking the trace is the one used for this step too (otherwise, there is a good chance of the addresses not being the same).
== Memory Usage ==
try (FileReader fr = new FileReader(mappingFile);
BufferedReader reader = new BufferedReader(fr);) {
for (String line = reader.readLine(); line != null; line = reader.readLine()) {
- String[] elems = line.split(" "); //$NON-NLS-1$
/* Only lines with 3 elements contain addresses */
+ String[] elems = line.split(" ", 3); //$NON-NLS-1$
if (elems.length == 3) {
/* Strip the leading zeroes from the address */
String address = elems[0].replaceFirst("^0+(?!$)", ""); //$NON-NLS-1$ //$NON-NLS-2$;