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

Enable breakpoints in 'with' augmentations for class types #608

Closed
wants to merge 1 commit into from

Conversation

dedale
Copy link
Contributor

@dedale dedale commented Aug 31, 2015

Close #551

I could successfully validate my fix with @dsyme minimal repro code once my F# SDK has been clobbered ✌️

It seems the doc is wrong:

  • version is not 5099 but 9055
  • I'm not sure about it, but I think that most msbuild commands to test in VS in release are already included in appveyor script. So I guess the procedure might be simplified.

@msftclas
Copy link

Hi @dedale, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@dedale
Copy link
Contributor Author

dedale commented Aug 31, 2015

image

@dedale
Copy link
Contributor Author

dedale commented Aug 31, 2015

Mmm, it seems it works only once. If I disable the breakpoint, I cannot set it back again 😟

@latkin
Copy link
Contributor

latkin commented Aug 31, 2015

Thanks @dedale ! Have you debugged into it to see why subsequent breakpoint sets aren't working?

@dedale
Copy link
Contributor Author

dedale commented Aug 31, 2015

No, I only tried in release. To debug, I will need two VS instances I guess?
Load fsharp.sln in first instance and attach to second instance?

@latkin
Copy link
Contributor

latkin commented Aug 31, 2015

You should do a debug build of the repo, then launch an instance of VS which loads those bits. The EnableOpenSource project should allow you to do that.

Attach your original instance to the debug instance, then run through the scenario and see if/how setting the second BP fails

@dedale
Copy link
Contributor Author

dedale commented Aug 31, 2015

OK, I'll try this.

@latkin
Copy link
Contributor

latkin commented Sep 3, 2015

Hi @dedale - I looked into this a bit today. Your change is valid, and indeed fixes a breakpoint-setting bug, but AFAICT it doesn't fix #551 at all 😄

The additional field you are capturing and walking corresponds to the copy expression in a record "copy and update" expression. So whereas one could not previously set a breakpoint here:

type Rec = { X : int }

let copyRec (r1 : Rec) (r2 : Rec) n =
    { 
        (if n % 2 = 0 then
            r1 // <-- try to set BP here
         else
            r2)
        with X = n
    }

With your change this now works.

Before:
image

After:
image

Nice job! My only suggestion would be to give this a better name: instead of os, something like copyExprOpt.

@dedale
Copy link
Contributor Author

dedale commented Sep 3, 2015

Thanks @latkin for your help. I'll amend my commit tonight to update PR.
For #551 I tried to debug but I could not understand more about the bug.

On Thu, Sep 3, 2015, 04:30 Lincoln Atkinson notifications@github.com
wrote:

Hi @dedale https://github.com/dedale - I looked into this a bit today.
Your change is valid, and indeed fixes a breakpoint-setting bug, but AFAICT
it doesn't fix #551 #551
at all [image: 😄]

The additional field you are capturing and walking corresponds to the copy
expression in a record "copy and update" expression. So whereas one could
not previously set a breakpoint here:

type Rec = { X : int }
let copyRec (r1 : Rec) (r2 : Rec) n =
{
(if n % 2 = 0 then
r1 // <-- try to set BP here
else
r2)
with X = n
}

With your change this now works.

Before:
[image: image]
https://cloud.githubusercontent.com/assets/5943573/9649330/544f4d4c-51a8-11e5-99ad-3fd868611e6c.png

After:
[image: image]
https://cloud.githubusercontent.com/assets/5943573/9649332/5f5e816c-51a8-11e5-997e-df1609b206a3.png

Nice job! My only suggestion would be to give this a better name: instead
of os, something like copyExprOpt.


Reply to this email directly or view it on GitHub
#608 (comment)
.

@enricosada
Copy link
Contributor

@dedale just change the commit message, the commit is good! 👍 great fix

@latkin latkin closed this in 02ff9c3 Sep 3, 2015
@latkin latkin added the fixed label Sep 3, 2015
@latkin
Copy link
Contributor

latkin commented Sep 3, 2015

I went ahead and made the requested changes before merging, thanks!

@latkin latkin added this to the F# 4.0 Update 1 milestone Sep 3, 2015
@dedale
Copy link
Contributor Author

dedale commented Sep 3, 2015

Ok thanks
Sorry I could not merge earlier.

On Thu, Sep 3, 2015, 18:57 Lincoln Atkinson notifications@github.com
wrote:

Closed #608 #608 via
02ff9c3
02ff9c3
.


Reply to this email directly or view it on GitHub
#608 (comment).

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

Successfully merging this pull request may close these issues.

Breakpoints do not work in (some?) large methods in VS2015 RTM
4 participants