Skip to content

Conversation

@mibac138
Copy link

Instead of using mono_debug_print_stack_frame for trace method names, just use mono_method_get_reflection_name which is internally used by the first method anyway. The method normalization that is performed is mostly just removing the extra stuff that debug_print_stack_frame adds and converting it back to get_reflection_name. It's simpler and less brittle to just use the method directly. debug_print_stack_frame is still used for stack traces in desyncs, this only changes the way we get the method name used by trace hashes.

Example output of the new Dump addr info table debug action that shows: in the first column (NORM:) the normalized name (using get_reflection_name), the hash (H:), and the full name (R: using debug_print_stack_frame)

NORM: `Verse.AI.WanderUtility+<>c__DisplayClass6_0.<GetHerdWanderRoot>b__0(Verse.Thing)`                                                 H:    1639916516 R:`at Verse.AI.WanderUtility/<>c__DisplayClass6_0.<GetHerdWanderRoot>b__0 (Verse.Thing) [0x0004a] in <24d25868955f4df08b02c73b55f389fe>:0`
NORM: `RimWorld.Pawn_FilthTracker.GainFilth(Verse.ThingDef)`                                                                             H:   -1324417192 R:`at RimWorld.Pawn_FilthTracker.GainFilth (Verse.ThingDef) [0x0001d] in <24d25868955f4df08b02c73b55f389fe>:0`
NORM: `Verse.Pawn.TickInterval(int)`                                                                                                     H:    1499760298 R:`at Verse.Pawn.TickInterval (int) [0x00355] in <24d25868955f4df08b02c73b55f389fe>:0`
NORM: `Verse.AI.JobGiver_Wander.TryGiveJob(Verse.Pawn)`                                                                                  H:    -624169555 R:`at Verse.AI.JobGiver_Wander.TryGiveJob (Verse.Pawn) [0x00143] in <24d25868955f4df08b02c73b55f389fe>:0`
NORM: `Verse.AI.JobDriver.Notify_PatherArrived()`                                                                                        H:    -990082523 R:`at Verse.AI.JobDriver.Notify_PatherArrived () [0x0001e] in <24d25868955f4df08b02c73b55f389fe>:0`
NORM: `Verse.AI.JobDriver.TryActuallyStartNextToil()`                                                                                    H:     911940829 R:`at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x00217] in <24d25868955f4df08b02c73b55f389fe>:0`

@notfood notfood added enhancement New feature or request. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels Oct 10, 2025
@notfood notfood moved this to In review in 1.6 and Odyssey Oct 10, 2025
@notfood notfood merged commit 45c95d6 into rwmt:dev Oct 15, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from In review to Done in 1.6 and Odyssey Oct 15, 2025
@mibac138 mibac138 deleted the method-name-normalize branch October 15, 2025 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). enhancement New feature or request.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants