RFR [S]: 8079473: allow demangling to be optional in dll_address_to_function_name

David Holmes david.holmes at oracle.com
Fri Jun 12 03:53:51 UTC 2015


Hi Bertrand,

This all looks okay to me. Thanks for the detailed description.

Thanks,
David

On 28/05/2015 11:52 PM, Bertrand Delsart wrote:
> Hi all,
>
> Here is a webrev that add a 'demangle' argument to
> dll_address_to_function_name so as to make the demangling optional. The
> webrev also includes some limited cleanup and fixes an issue I noticed
> on windows.
>
> https://bugs.openjdk.java.net/browse/JDK-8079473
> http://cr.openjdk.java.net/~bdelsart/8079473/
>
> Fix is targeted at JDK9 and will be pushed through hs-rt.
>
> This enhancement is currently used only by some closed extensions. It
> has been validated on linux and the fix is very similar on all platforms
> except AIX.
>
> I've quickly implemented the AIX version but could not test it. Let me
> know if you would prefer me to remove the AIX code and just ensure that
> the 'demangle' argument is ignored on that platform.
>
> The cleanup is about optional arguments to decode, which were redefined
> in the overridden versions for the different operating systems. To avoid
> weird behaviors, the default values should be defined only in the
> toplevel class AbstractDecoder, not the subclasses (but that was OK as
> long as the default values were identical)
>
> On Windows, I discovered a bug while adding the non-demangling support.
> This old code from WindowsDecoder::decode should not behave as expected
> if really used:
>          if (demangle(pSymbol->Name, buf, buflen)) {
>            jio_snprintf(buf, buflen, "%s", pSymbol->Name);
>          }
> The code is supposed to write in 'buf' the raw form when the demangling
> fails. Hence, the jio_snprintf should be executed when demangle returns
> false. The code above fails to properly set buf when the demangling
> fails and also replaced the demangled form by the raw form when
> demangling succeeded.
>
> It should have been "if (! demangle(...". With my extension, it now is
> "if (!(demangle_name && demangle(...", like on other platforms.
>
> Best regards,
>
> Bertrand.


More information about the hotspot-runtime-dev mailing list