Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Sep 2012 14:15:13 +0200
From:      Stefan Farfeleder <stefanf@FreeBSD.org>
To:        Rui Paulo <rpaulo@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r240156 - head/lib/libproc
Message-ID:  <20120906121513.GG1361@mole.fafoe.narf.at>
In-Reply-To: <201209060319.q863JnDe050504@svn.freebsd.org>
References:  <201209060319.q863JnDe050504@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120906121513.GG1361>