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

Fix line stepping in debugger. #37310

Merged
merged 1 commit into from
Oct 22, 2016
Merged

Fix line stepping in debugger. #37310

merged 1 commit into from
Oct 22, 2016

Conversation

vadimcn
Copy link
Contributor

@vadimcn vadimcn commented Oct 20, 2016

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.

Fixes #37032

r? @michaelwoerister

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.
@vadimcn
Copy link
Contributor Author

vadimcn commented Oct 20, 2016

I've opted to ignore the fact that span.lo actually points after the brace, because doing it "correctly" would require analyzing codemap for multibyte characters (as you pointed out on IRC). Which is costly, and brings zero benefit: a brace is always followed by \n at the minimum, so the line number will be correct, which is all a debugger cares for. The only exception to that is when a brace is the last character in a file, but somehow this case also seems to work correctly.

@arielb1
Copy link
Contributor

arielb1 commented Oct 20, 2016

Multibyte characters? Isn't a brace always a single-byte character?

@michaelwoerister
Copy link
Member

@arielb1 Yes, but not all scopes end with braces :)

a brace is always followed by \n at the minimum, so the line number will be correct

That's an interesting observation! From what you've written I assume you've tried it out in the debugger?

@michaelwoerister
Copy link
Member

From what you've written I assume you've tried it out in the debugger?

The test case covers the interesting cases, I think.

@michaelwoerister
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 20, 2016

📌 Commit 209fe0d has been approved by michaelwoerister

Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 22, 2016
Fix line stepping in debugger.

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.

Fixes rust-lang#37032

r? @michaelwoerister
@bors
Copy link
Contributor

bors commented Oct 22, 2016

⌛ Testing commit 209fe0d with merge 0eb4d46...

bors added a commit that referenced this pull request Oct 22, 2016
Fix line stepping in debugger.

Attribute drop code to block's closing brace, instead of the line where the allocation was done.
Attribute function epilogues to function body's closing brace, rather than the function header.

Fixes #37032

r? @michaelwoerister
@michaelwoerister
Copy link
Member

🎉
Thanks again for the awesome PR, @vadimcn !

@bors bors merged commit 209fe0d into rust-lang:master Oct 22, 2016
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.

4 participants