dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.21k stars 4.72k forks source link

[Linux] PAL functions usage from native code (debugger) #13509

Closed viewizard closed 4 years ago

viewizard commented 5 years ago

Hello, I noticed, that in CoreCLR 3.0 preview7 was added https://github.com/dotnet/coreclr/commit/a6292a6573e1f7d6e218293773e443280683cd83 commit, that remote export for PAL functions. For now, we use them in our NetCoreDBG debugger (https://github.com/Samsung/netcoredbg/blob/886fd637f4c6d4eeca077cb5d5a1eacc95a813ea/src/debug/netcoredbg/symbolreader.cpp#L177). Is it possible revert back export for PAL in order to make native->native usage of PAL functions? Or qcalls is the only way for direct PAL usage from now and this feature will be available in future CoreCLR versions for sure?

jkotas commented 5 years ago

We consider the Windows PAL to be internal implementation detail of CoreCLR. We plan to make it smaller and lighter weight over time. Ideally, it would disappear eventually.

The 5 functions you have linked are trivial wrappers over malloc/free. You should be able to make a local version of these wrappers in NetCoreDBG to avoid depending of CoreCLR internals.

viewizard commented 5 years ago

@jkotas, you right, looks like I could just implement this 5 functions. Thanks for your help!