Skip to content

Commit

Permalink
Include args in hostfxr entry point tracing (#83605)
Browse files Browse the repository at this point in the history
  • Loading branch information
elinor-fung committed Mar 18, 2023
1 parent 87b73f0 commit 4a1dd91
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/native/corehost/fxr/hostfxr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ SHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_resolve_sdk2(
hostfxr_resolve_sdk2_result_fn result)
{
trace_hostfxr_entry_point(_X("hostfxr_resolve_sdk2"));
trace::info(
_X(" exe_dir=%s\n")
_X(" working_dir=%s\n")
_X(" flags=%d"),
exe_dir == nullptr ? _X("<nullptr>") : exe_dir,
working_dir == nullptr ? _X("<nullptr>") : working_dir,
flags);

if (exe_dir == nullptr)
{
Expand Down Expand Up @@ -315,6 +322,7 @@ SHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_get_available_sdks(
hostfxr_get_available_sdks_result_fn result)
{
trace_hostfxr_entry_point(_X("hostfxr_get_available_sdks"));
trace::info(_X(" exe_dir=%s"), exe_dir == nullptr ? _X("<nullptr>") : exe_dir);

if (exe_dir == nullptr)
{
Expand Down Expand Up @@ -350,6 +358,9 @@ SHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_get_dotnet_environment_info(
hostfxr_get_dotnet_environment_info_result_fn result,
void* result_context)
{
trace_hostfxr_entry_point(_X("hostfxr_get_dotnet_environment_info"));
trace::info(_X(" dotnet_root=%s"), dotnet_root == nullptr ? _X("<nullptr>") : dotnet_root);

if (result == nullptr)
{
trace::error(_X("hostfxr_get_dotnet_environment_info received an invalid argument: result should not be null."));
Expand Down Expand Up @@ -484,6 +495,15 @@ SHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_get_dotnet_environment_info(
SHARED_API int32_t HOSTFXR_CALLTYPE hostfxr_get_native_search_directories(const int argc, const pal::char_t* argv[], pal::char_t buffer[], int32_t buffer_size, int32_t* required_buffer_size)
{
trace_hostfxr_entry_point(_X("hostfxr_get_native_search_directories"));
if (trace::is_enabled())
{
trace::info(_X(" args=["));
for (int i = 0; i < argc; ++i)
{
trace::info(_X(" %s"), argv[i]);
}
trace::info(_X(" ]"));
}

if (buffer_size < 0 || (buffer_size > 0 && buffer == nullptr) || required_buffer_size == nullptr)
{
Expand Down

0 comments on commit 4a1dd91

Please sign in to comment.