possible pdb+async issue

108 views
Skip to first unread message

Simon

unread,
Nov 4, 2012, 4:06:03 AM11/4/12
to mono-...@googlegroups.com
JB


So someone raised this bug with NPW

And it turns out it effects the other MSBuild project where I use cecil.

It manifests as such...

Given this

[TestFixture]
public class AsyncTest
{
    [Test]
    public void TestAsynch()
    {
        AsyncDebuggerTest();
    }

    public async void AsyncDebuggerTest()
    {
        var test = await getTestString();
        //set breakpoint on next line and look at 'test' variable in debugger
        var test2 = test + test;
    }

    private async Task<string> getTestString()
    {
        return "test";
    }
}

you cant view the "test" variable in AsyncDebuggerTest

if I remove the async code I can view "test"

[TestFixture]
public class NonAsyncTest
{
    [Test]
    public void TestAsynch()
    {
        AsyncDebuggerTest();
    }

    public void AsyncDebuggerTest()
    {
        var test = getTestString();
        //set breakpoint on next line and look at 'test' variable in debugger
        var test2 = test + test;
    }

    private string getTestString()
    {
        return "test";
    }
}

See CecilDebugIssue project in the attachment for the above two classes


If I remove cecil from the equation I can view the "test" variable in the async case. See WithNoCecil project in attachment

I have included the bin+obj dir in the attachment so you can have a look at the pdb and dlls

my module reader code is here
and my module write code is here

is this enough to go on?  I know it is a complicated repro but I am hoping it is enough for you to go on.

Regards 
Simon

Jb Evain

unread,
Nov 4, 2012, 9:11:06 AM11/4/12
to mono-...@googlegroups.com
I'am not surprised.

We're already messing with iterators, see https://github.com/jbevain/cecil/issues/4

It's no surprise we have an issue with async methods.

Jb


Simon

--
--
mono-cecil

Simon Cropp

unread,
Nov 4, 2012, 2:34:15 PM11/4/12
to mono-...@googlegroups.com
Looks like there are a couple of ways forward in that issue.

Are you not confident in the quality of the patches?
--
--
mono-cecil

Simon

unread,
Nov 5, 2012, 7:30:58 AM11/5/12
to mono-...@googlegroups.com

And I can now view the variable in the iterator block so it looks like atykhyy had the fix right.


And I have no idea if it broke anything else :)

Simon

unread,
Nov 5, 2012, 8:21:45 PM11/5/12
to mono-...@googlegroups.com
but it does pass all the unit tests :)

Simon

unread,
Nov 8, 2012, 2:41:58 AM11/8/12
to mono-...@googlegroups.com
thoughts?
Reply all
Reply to author
Forward
0 new messages