svn commit: r240156 - head/lib/libproc
Stefan Farfeleder
stefanf at FreeBSD.org
Thu Sep 6 12:15:17 UTC 2012
On Thu, Sep 06, 2012 at 03:19:49AM +0000, Rui Paulo wrote:
> @@ -266,7 +268,11 @@ proc_addr2sym(struct proc_handle *p, uin
> if (addr >= rsym && addr <= (rsym + sym.st_size)) {
> s = elf_strptr(e, dynsymstridx, sym.st_name);
> if (s) {
> - strlcpy(name, s, namesz);
> + if (strlen(s) > 2 &&
> + s[0] == '_' && s[1] == 'Z')
> + __cxa_demangle(s, name, &namesz, NULL);
> + else
> + strlcpy(name, s, namesz);
> memcpy(symcopy, &sym, sizeof(sym));
> /*
> * DTrace expects the st_value to contain
According to the documentation, __cxa_demangle will realloc the buffer
if it is too small and return the new buffer. This case is not handled
correctly.
Stefan
More information about the svn-src-head
mailing list