Skip to content

[mono] Remove some domain stuff from the debugger#103186

Merged
kg merged 4 commits into
dotnet:mainfrom
kg:debugger-domains
Jun 19, 2024
Merged

[mono] Remove some domain stuff from the debugger#103186
kg merged 4 commits into
dotnet:mainfrom
kg:debugger-domains

Conversation

@kg

@kg kg commented Jun 8, 2024

Copy link
Copy Markdown
Contributor

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

@lambdageek lambdageek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I'd use mono_get_root_domain more than mono_domain_get. it's cheaper and doesn't invite questions of "does this function care about being called on an unattached thread?"

Comment thread src/mono/mono/component/debugger-engine.c Outdated
Comment thread src/mono/mono/component/debugger-engine.c Outdated
@kg kg marked this pull request as ready for review June 10, 2024 21:54
@kg kg requested a review from marek-safar as a code owner June 10, 2024 21:54
@kg

kg commented Jun 11, 2024

Copy link
Copy Markdown
Contributor Author

@lambdageek

lambdageek commented Jun 11, 2024

Copy link
Copy Markdown
Member

Does anyone know why https://github.com/dotnet/runtime/pull/103186/files#diff-1492a44134220d0f70af248aa7524cfc5e03795d922b90381eaa3b2fea5955deR96 would be failing? How could we have another domain?

It's called from here

mono_profiler_set_domain_loaded_callback (prof, appdomain_load);

But the mono_root_domain global is assigned after the profiler event is raised:

domain = create_root_domain ();
mono_root_domain = domain;

MONO_PROFILER_RAISE (domain_loaded, (domain));

So when mono_de_domain_add executes, mono_get_root_domain is still returning null

@kg

kg commented Jun 11, 2024

Copy link
Copy Markdown
Contributor Author

Does anyone know why https://github.com/dotnet/runtime/pull/103186/files#diff-1492a44134220d0f70af248aa7524cfc5e03795d922b90381eaa3b2fea5955deR96 would be failing? How could we have another domain?

It's called from here

mono_profiler_set_domain_loaded_callback (prof, appdomain_load);

But the mono_root_domain global is assigned after the profiler event is raised:

domain = create_root_domain ();
mono_root_domain = domain;

MONO_PROFILER_RAISE (domain_loaded, (domain));

So when mono_de_domain_add executes, mono_get_root_domain is still returning null

Thanks! Do you think we should assign the global before firing the profiler event? That seems right to me

@lambdageek

Copy link
Copy Markdown
Member

Do you think we should assign the global before firing the profiler event? That seems right to me

I think so too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants