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

debuginfo: Emit DW_AT_accessibility attributes #74778

Closed
wants to merge 1 commit into from
Closed

debuginfo: Emit DW_AT_accessibility attributes #74778

wants to merge 1 commit into from

Conversation

ernestask
Copy link

@ernestask ernestask commented Jul 26, 2020

No description provided.

Currently, the DWARF attributes for struct member accessibility are not
emitted, even though ty::FieldDef contains the information about the
visibility. This commit adds a mapping between ty::Visibility and
debuginfo::DIFlags for that when creating member descriptions.

Closes #9228
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2020
@ernestask ernestask marked this pull request as draft July 26, 2020 14:22
@oli-obk
Copy link
Contributor

oli-obk commented Jul 26, 2020

r? @michaelwoerister

@tesuji
Copy link
Contributor

tesuji commented Jul 26, 2020

I believe Michael is talking a rest (or retired from T-compiler) and would not return soon.

@tesuji
Copy link
Contributor

tesuji commented Jul 27, 2020

r? @eddyb

@bjorn3
Copy link
Member

bjorn3 commented Aug 5, 2020

Should this use DW_AT_visibility instead?

DW_AT_accessibility:

Some languages, notably C++ and Ada, have the concept of the accessibility of an object or of some other program entity. The accessibility specifies which classes of other program objects are permitted access to the object in question.

DW_AT_visibility:

Several languages (such as Modula-2) have the concept of the visibility of a declaration. The visibility specifies which declarations are to be visible outside of the entity in which they are declared.

I think DW_AT_accessibility is about if a member of a class is accessible only by other members of the class, also members of subclasses or everyone. I think DW_AT_visibility on the other hand is about if something is accessible by other members of the same module, or also outside of it.

cc @tromey?

@ernestask ernestask closed this Aug 7, 2020
@ernestask ernestask deleted the wip/ernestask/debuginfo-accessibility branch August 7, 2020 12:37
@tromey
Copy link
Contributor

tromey commented Aug 13, 2020

I think DW_AT_accessibility is about if a member of a class is accessible only by other members of the class, also members of subclasses or everyone. I think DW_AT_visibility on the other hand is about if something is accessible by other members of the same module, or also outside of it.

Sorry about the delay on this. Neither of these seem like an exact fit for Rust, I suppose. Since it's routine for debuggers to have to do language-specific handling for various constructs, I'd just pick one -- like, if one is simpler to do in LLVM, that's reason enough.

@tromey
Copy link
Contributor

tromey commented Aug 13, 2020

Also, I didn't see a reason for closing this. Was it replaced by a different PR or something? It seemed reasonable enough to me ... actually at first I'd thought it had landed and was going to look at implementing the support in gdb.

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 26, 2023
…ember-visibility, r=wesleywiser

codegen_llvm: set `DW_AT_accessibility`

Fixes rust-lang#9228.
Based on rust-lang#74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 25, 2023
…ember-visibility, r=wesleywiser

codegen_llvm: set `DW_AT_accessibility`

Fixes rust-lang#9228.
Based on rust-lang#74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2023
…ember-visibility, r=wesleywiser

codegen_llvm: set `DW_AT_accessibility`

Fixes rust-lang#9228.
Based on rust-lang#74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2023
…ember-visibility, r=wesleywiser

codegen_llvm: set `DW_AT_accessibility`

Fixes rust-lang#9228.
Based on rust-lang#74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2023
…ember-visibility, r=wesleywiser

codegen_llvm: set `DW_AT_accessibility`

Fixes rust-lang#9228.
Based on rust-lang#74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants