Skip to content

Extend oop api2 #2123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged

Extend oop api2 #2123

merged 1 commit into from
Apr 14, 2025

Conversation

MindWrapper
Copy link

@MindWrapper MindWrapper commented Mar 31, 2025

Capture assembly file name

  • Should this pull request have release notes?
    • Yes
    • No
  • Do these changes need to be back ported?
    • Yes
    • No
  • Do these changes need to be upstreamed to mono/mono or dotnet/runtime repositories?
    • Yes
    • No

Reviewers: please consider these questions as well! ❤️

Release notes

Internal

https://github.cds.internal.unity3d.com/unity/unity/pull/66061

@unity-cla-assistant
Copy link
Collaborator

unity-cla-assistant commented Mar 31, 2025

CLA assistant check
All committers have signed the CLA.

@@ -425,6 +470,11 @@ mono_unity_oop_get_stack_frame_details(
frameDetails->assemblyNameLen,
read_pointer(OFFSET_MEMBER(MonoImage, image, assembly_name)));

frameDetails->assemblyNameLen = read_nt_string(
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a copy/paste error, and you want to assign to assemblyFileNameLen?


// the line below will lead to access violation as code_start point to non-initialized memory
// so probably oop_jit_info_table_find above didn't fully intitialized ji ?
gpointer code_starts = ji->code_start;
Copy link
Member

Choose a reason for hiding this comment

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

The ji is a pointer in the address space of another process. You likely need:

gpointer code_starts = read_pointer(OFFSET_MEMBER(MonoJitInfo, ji, code_start));

// so probably oop_jit_info_table_find above didn't fully intitialized ji ?
gpointer code_starts = read_pointer(OFFSET_MEMBER(MonoJitInfo, ji, code_start));

gint32 relative_address = (gint32)((char*)frameAddress - (char*)code_starts);
Copy link
Author

Choose a reason for hiding this comment

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

@joncham now relative_address work correctly, however hitting this condition.

if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)

I guess we need to add mono_oop_debug_init ? Is that feasible?

Minor md update

Initial implementation of mono_unity_oop_debug_lookup_source_location

Fix copy-paste error

fixed code_start calulation

Fix typo

remove mono_unity_oop_debug_lookup_source_location

Remove unused include

Rollback other unnecessary changes
@MindWrapper MindWrapper marked this pull request as ready for review April 9, 2025 12:49
@MindWrapper MindWrapper requested a review from joncham April 9, 2025 12:49
@MindWrapper MindWrapper merged commit 551b20e into unity-6000.2-mbe Apr 14, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants