Loss of debug info in async methods
See original GitHub issueHi,
there seems to be a problem with debug info in async
methods: local variables disappear (this is visible in the provided sample) and it seems that the trace (step over from debugger) is also broken (but this is not visible from the sample).
Here is how to reproduce the problem using the attached solution:
- first of all, if you run the debugger on the project
DnlibAsync
, when you trace into the method namedAsync()
, you can see that the local variable is visible, and correctly set. - now, run the
LoadSaveAssembly
project: it will loadDnlibAsync.exe
andDnlibAsync.pdb
fromobj
directory usingdnlib
and simply write them tobin
. - when you start the debugger in the project
DnlibAsync
, now the local variable inAsync()
method has disappeared (the method works, the generated code has not changed, so this must be the debug info which has changed).
I tried used both symbol loaders (PdbImplType.Managed
an PdbImplType.MicrosoftCOM
) and get the same result.
Since the example is dumb as hell, I don’t see a point I could have missed in my implementation (which of course, doesn’t mean I 100% sure I made everything right 😎). So, do you think this is a bug?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:16
Top Results From Across the Web
Why can't I debug code in an async method?
When I run the application, the debugger will call into my GetDataAsync() method which in turn calls into the GetData() method.
Read more >Psychic Debugging of Async Methods
This symptom is oftem caused by one of three things, or variations off of these: A) An async lambda is passed to a...
Read more >Why is Async code hard to debug? - YouTube
Isadora Rodopoulos, an engineer on the Visual Studio Debugging team, joins us to kick off a mini-series on debugging async code.
Read more >Why exceptions in async methods are “dangerous” in C# | ...
If we debug the result, it shows that we have two exceptions, but with no possibility of doing something more accurate in terms...
Read more >Problem Inspecting local variables in Async method. : r/swift
This is making it really difficult to debug async code. Does anyone know if there is a fix for this, or why it's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@picrap I’ll have a look at it this month, I don’t know how long it will take. There’s a lot of undocumented things, but source code (i.e., Roslyn, Pdb2Xml) exist.
@0xd4d any schedule for this? I am quite stuck with this (and my projects are also impacted).