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 22590 - importC: static functions have no debug information… #13640
Conversation
Thanks for your pull request, @WalterBright! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#13640" |
test? |
I pretty much dictated the fix in the issue, so I know that this will make debug generation work for static functions. But why? |
The SDsym is set when functions are placed in COMDATs. But static symbols are not in COMDATs. |
@thewilsonator we don't have a good way to test debug info generation. |
@thewilsonator historically, PRs that fixed debug info issues were not required any tests. Although, a fail compilation tests which ends up in a SEGV for which the output is checked by a bash script wouldn't be too difficult to add. |
6ccbb92
to
3d46908
Compare
False. The test runner explicitly supports See e.g. https://github.com/dlang/dmd/blob/f0d454a3dadeb70a51e780705126e49258c815fc/test/runnable/gdb4149.d |
@MoonlightSentinel great! Can you show how to make one for this? |
A small example: /// runnable/debuginfo.c
/*
REQUIRED_ARGS: -g
PERMUTE_ARGS:
GDB_SCRIPT:
---
run
---
GDB_MATCH: \*ptr = 1
*/
static
void foo(int* ptr)
{
*ptr = 1;
}
int main(int argc, char** argv)
{
foo(0);
return 0;
} GDB will print the line number + |
@WalterBright #13081 is another small example |
… generated for them
3d46908
to
821f18e
Compare
@MoonlightSentinel thanks I added your example as a test. |
… generated for them
Let's see if this works.