Skip to content
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

[ILSpy.ReadyToRun] Decorate the disassembly with DebugInfo #1886

Open
cshung opened this issue Jan 2, 2020 · 1 comment
Open

[ILSpy.ReadyToRun] Decorate the disassembly with DebugInfo #1886

cshung opened this issue Jan 2, 2020 · 1 comment

Comments

@cshung
Copy link
Contributor

cshung commented Jan 2, 2020

To enable debugging, debug information is emitted along with the code. The debug information comes in two groups. There is a mapping between IL instruction offset to native instruction offset, and there is a mapping between a number that represents an argument/IL local to the native location. The latter is associated with a code range when the mapping is valid - (i.e. The compiler could optimize a variable's location away if it decides the value is no longer needed)

When the debuggee is stopped at a certain point, the register context can tell us where is the current program counter, we can use that to find out what method is being executed, then we can find out what IL offset is it using the native offset and then the mapping, then we can find out where the local variables are.

For disassembly inspection purposes, we can weave the IL instructions/C# source lines with the disassembly using the IL offset mapping, and we can also decorate the arguments/local variable access assembly code with the argument or local variable number/names.

@cshung
Copy link
Contributor Author

cshung commented Sep 23, 2023

The work in #2067 improved the decoration significantly. Moving forward, it would be nice if we could decorate it with local names instead of local IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants