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 issue 21153 - DWARF: DMD emits the mangled name for DW_AT_name #11540

Merged
merged 3 commits into from
Aug 20, 2020

Conversation

Luhrel
Copy link
Contributor

@Luhrel Luhrel commented Aug 9, 2020

As gdb is intelligent, DW_AT_name is automatically demangled, if necessary.
So, this commit seems useless, however, for data consistency between DW_AT_name and DW_AT_linkage_name, this is necessary.

There's still some DWARF issues with DMD (like the module name before the variable name, see below), but that's for another PR (coming soon).

@dlang-bot
Copy link
Contributor

dlang-bot commented Aug 9, 2020

Thanks for your pull request and interest in making D better, @Luhrel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
21153 trivial DWARF: DMD emits the mangled name for DW_AT_name

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#11540"

@MoonlightSentinel
Copy link
Contributor

Could you add a test case using GDB_SCRIPT?

@Luhrel
Copy link
Contributor Author

Luhrel commented Aug 9, 2020

Could you add a test case using GDB_SCRIPT?

Of course.

@MoonlightSentinel
Copy link
Contributor

This should solve some debugging problems (notably in the pubnames section)

Also add a bugzilla issue to the commit title.

@Luhrel Luhrel force-pushed the dwarf_prettyIdent branch from 3097e4a to aff93d7 Compare August 9, 2020 21:52
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

As already requested please add a reference to a bugzilla entry please. Create it if required. This is just for the changelog.

@Luhrel Luhrel changed the title DWARF: set DW_AT_name to prettyIdent instead of mangle name Fix issue 21153 - DWARF: DMD emits the mangled name for DW_AT_name Aug 13, 2020
@Luhrel Luhrel requested a review from a user August 13, 2020 13:19
@ibuclaw
Copy link
Member

ibuclaw commented Aug 13, 2020

DW_AT_name ("bar.x")

If modules are implemented, you'll want to drop the bar part from the AT_name.

@Luhrel
Copy link
Contributor Author

Luhrel commented Aug 13, 2020

DW_AT_name ("bar.x")

If modules are implemented, you'll want to drop the bar part from the AT_name.

Yes, but that's another bug 21155

@Luhrel
Copy link
Contributor Author

Luhrel commented Aug 16, 2020

@MoonlightSentinel As I'll push a lot of DWARF fixes and enhancements, is there a good way to test all those things ?

With GDB_SCRIPT, I can't check that everything is fine, because gdb doesn't allow us to test the tags etc.
I always can use llvm-dwarfdump or objdump, but the tests are gonna fail with the other compilers.

@MoonlightSentinel
Copy link
Contributor

@MoonlightSentinel As I'll push a lot of DWARF fixes and enhancements, is there a good way to test all those things ?

You could add a dshell test which compiles a test file and check the output of objdump. Future PR's can then extends this test with new checks.

... but the tests are gonna fail with the other compilers.

LDC/GDC already ignore certain dmd specific tests. Your changes don't affect them anyway?

@Luhrel
Copy link
Contributor Author

Luhrel commented Aug 16, 2020

@MoonlightSentinel As I'll push a lot of DWARF fixes and enhancements, is there a good way to test all those things ?

You could add a dshell test which compiles a test file and check the output of objdump. Future PR's can then extends this test with new checks.

Yeah, gonna do this.

... but the tests are gonna fail with the other compilers.

LDC/GDC already ignore certain dmd specific tests. Your changes don't affect them anyway?

Yes, my changes only affects DMD.

@Luhrel Luhrel force-pushed the dwarf_prettyIdent branch from 543d383 to 29866cf Compare August 16, 2020 22:43
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
@Luhrel Luhrel force-pushed the dwarf_prettyIdent branch 2 times, most recently from aec4206 to 6066815 Compare August 17, 2020 11:27
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
@Luhrel Luhrel force-pushed the dwarf_prettyIdent branch from 6066815 to 75230b4 Compare August 17, 2020 12:51
@Luhrel
Copy link
Contributor Author

Luhrel commented Aug 17, 2020

Merde.
The auto-tester fails on some machines.

std.process.ProcessException@std/process.d(885): Executable file not found: objdump

Copy link
Contributor

@MoonlightSentinel MoonlightSentinel left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel left a comment

Choose a reason for hiding this comment

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

LGTM. Any objections on the dshell test @wilzbach ?

Copy link
Member

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

I don't see anything blocking it

test/dshell/dwarf.d Outdated Show resolved Hide resolved
test/dshell/dwarf.d Outdated Show resolved Hide resolved
@Luhrel Luhrel force-pushed the dwarf_prettyIdent branch from 38bfe9a to e855919 Compare August 20, 2020 09:49
@Luhrel Luhrel requested a review from wilzbach August 20, 2020 09:52
@dlang-bot dlang-bot merged commit ae7f2aa into dlang:master Aug 20, 2020
@Luhrel Luhrel deleted the dwarf_prettyIdent branch August 20, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants