Skip to content

Conversation

@topolarity
Copy link
Contributor

Technically these are not addresses in memory, so it's important to use dbg.value instead of dbg.declare

Also insert the debug instrinsic just after the instruction that defines it.

Without this change, almost none of the local SSA values are available in gdb (it might be just the arguments that are) but with it I can very often print the arguments of the instruction execution is halted on:
image

Also insert the debug instrinsic just after the instruction that
defines it.

Technically these are not addresses in memory, so it's important to
use `dbg.value` instead of `dbg.declare`.

Without this change, almost none of the local SSA values are
available in gdb (it might be just the arguments that are) but
with it I can very often print the arguments of the instruction
execution is halted on.
@topolarity
Copy link
Contributor Author

This doesn't seem to work for PHINodes for some reason (they don't even show up in info locals), but it's a big improvement for other values based on my local tests

There seems to be a bug upstream that drops debuginfo for PHINodes
if they use a scope that is not used otherwise, so workaround this
by using the Subprogram scope instead.
@vaivaswatha vaivaswatha merged commit ce010e2 into vaivaswatha:master Dec 6, 2024
1 check passed
@topolarity topolarity deleted the dbg-value branch December 6, 2024 14:22
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.

2 participants