On 6 Sep 2012, at 05:15, Stefan Farfeleder <stef...@freebsd.org> wrote:

> 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.


You're right. In fact this happens all the time with libcxxrt.

Thanks,
--
Rui Paulo

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to