1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! `StateMachineMethod` table loader for efficient metadata processing
//!
//! This module provides the [`StateMachineMethodLoader`] implementation that handles
//! loading and processing `StateMachineMethod` table entries from Portable PDB metadata.
//! The loader follows the established `MetadataLoader` pattern for consistent parallel
//! processing and efficient memory utilization.
use crate::;
/// Metadata loader for `StateMachineMethod` table entries
///
/// This loader processes `StateMachineMethod` table data to build efficient lookup
/// structures for state machine debugging support. The loader handles:
///
/// - Parallel processing of table rows for optimal performance
/// - Building token-based lookup maps for fast method resolution
/// - Creating ordered lists for sequential access patterns
/// - Memory-efficient storage using reference counting
///
/// # State Machine Debugging Context
///
/// The `StateMachineMethod` table is crucial for modern .NET debugging because
/// async/await and iterator methods are implemented as state machines. Without
/// this mapping, debuggers would show confusing compiler-generated method names
/// and lose the connection to the original user code.
///
/// # Integration
///
/// This loader integrates with the broader metadata loading infrastructure:
/// - Uses the [`LoaderContext`] for coordinated loading across all tables
/// - Implements [`MetadataLoader`] trait for consistent processing patterns
/// - Provides thread-safe data structures for concurrent debugger access
///
/// # References
///
/// - [Portable PDB Format - StateMachineMethod Table](https://github.com/dotnet/corefx/blob/master/src/System.Reflection.Metadata/specs/PortablePdb-Metadata.md#statemachinemethod-table-0x36)
/// - [.NET State Machine Implementation](https://devblogs.microsoft.com/dotnet/how-async-await-really-works/)
;