Skip to content

Trait object debug - #45897

Merged
bors merged 2 commits into
rust-lang:masterfrom
tromey:trait-object-debug
Nov 17, 2017
Merged

Trait object debug#45897
bors merged 2 commits into
rust-lang:masterfrom
tromey:trait-object-debug

Conversation

@tromey

Copy link
Copy Markdown
Contributor

This enables better debugging of trait objects. See the individual commits for explanations. This required an LLVM bump.

@kennytmkennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 10, 2017
@bors

bors commented Nov 11, 2017

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #45806) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton

Copy link
Copy Markdown
Member

r? @michaelwoerister

@michaelwoeristermichaelwoerister left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @tromey!

@tromey
tromeyforce-pushed the trait-object-debug branch 2 times, most recently from 8c9a797 to ab4da8cCompareNovember 13, 2017 19:11
@tromey

Copy link
Copy Markdown
ContributorAuthor

So far I haven't managed to reproduce that failure.

@kennytmkennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2017
@tromey

Copy link
Copy Markdown
ContributorAuthor

My current theory is that this is failing due to an unmodified LLVM; and so the patch will need some tweaks.

@tromey

Copy link
Copy Markdown
ContributorAuthor

Looking at the patches, I still don't see how that would be possible, but I'm rebuilding without the LLVM patch to be sure.

@tromey

Copy link
Copy Markdown
ContributorAuthor

I rebuilt without the LLVM bump and didn't see this failure. Now I don't have a theory about what is going wrong. Maybe I need to build specifically against whatever LLVM travis is using.

@cuviper

Copy link
Copy Markdown
Member

The first CI run uses Ubuntu's llvm-3.9. The rest should use rust's own llvm.

@tromey

Copy link
Copy Markdown
ContributorAuthor

The first CI run uses Ubuntu's llvm-3.9

Thanks. I got it to fail with my system llvm.

@tromey

Copy link
Copy Markdown
ContributorAuthor

The bug is that the patch is passing in NULL for the linkage name of the vtable.

This adds a "min-system-llvm-version" directive, so that a test can
indicate that it will either work with rust-llvm or with some minimal
system LLVM. This makes it simpler to write a test that requires an
LLVM patch that landed upstream and was then backported to rust-llvm.
Emit better debugging information for a trait object pointer. In
particular, now:
* The fields are explicitly represented in the DWARF;
* DWARF for the vtable itself is emitted; and
* The DWARF for the vtable's type has a DW_AT_containing_type which
points to the concrete type for which the vtable was emitted. This is
a small DWARF extension, that allows debuggers to determine the real
type of the object to which a trait object points.
I'll submit the gdb patch to take advantage of this new debuginfo once
this lands.
The vtable type is not currently complete -- it doesn't include members
for the pointers it contains. This information was not needed for this
feature.
This addresses part 1 of rust-lang#1563.
@kennytmkennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 15, 2017
@kennytm

Copy link
Copy Markdown
Member

@tromey I think this is ready to be reviewed or merged? cc @michaelwoerister

@tromey

Copy link
Copy Markdown
ContributorAuthor

@kennytm yes - it was reviewed once, then I made a small change to address the test failures. A re-review would be good.

@michaelwoerister

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Nov 16, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit ae4cc60 has been approved by michaelwoerister

@kennytmkennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2017
@bors

bors commented Nov 16, 2017

Copy link
Copy Markdown
Collaborator

⌛ Testing commit ae4cc60 with merge d59f66d...

bors added a commit that referenced this pull request Nov 16, 2017
Trait object debug
This enables better debugging of trait objects. See the individual commits for explanations. This required an LLVM bump.
@bors

bors commented Nov 17, 2017

Copy link
Copy Markdown
Collaborator

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing d59f66d to master...

@bors
bors merged commit ae4cc60 into rust-lang:masterNov 17, 2017
@tromey
tromey deleted the trait-object-debug branch November 17, 2017 05:34
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@tromey@bors@alexcrichton@cuviper@kennytm@michaelwoerister