Skip to content

feat(variables): Register mapping DWARF <> x86_64 - #1117

Open
sentry-junior[bot] wants to merge 5 commits into
masterfrom
szokeasaurusrex/symbol-50-x86-64-register-mapping
Open

sentry-junior[bot] wants to merge 5 commits into
masterfrom
szokeasaurusrex/symbol-50-x86-64-register-mapping

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Implement register mapping from DWARF register numbers to x86_64 registers, represented with a new Amd64Register enum. The mapping follows the DWARF register number table of the System V AMD64 psABI.

VariableLocation::Register now holds a symbolic_common::Register instead of the raw DWARF number. There is no Unknown register: register locations on architectures without a mapping are omitted. This PR sits below the AArch64 mapping (#1115) in the stack. Our DWARF test fixtures are all x86_64, so the snapshots now show register names instead of numbers and no locations are lost.

Resolves #1116
Resolves SYMBOL-50

via @szokeasaurusrex.

--

View Junior Session [Sentry]

Co-Authored-By: Dr. Daniel Szokenstein <7881302+szokeasaurusrex@users.noreply.github.com>
@sentry-junior
sentry-junior Bot requested a review from a team as a code owner October 29, 2026 17:56
Co-Authored-By: Dr. Daniel Szokenstein <7881302+szokeasaurusrex@users.noreply.github.com>
@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

SYMBOL-50

sentry-junior Bot added a commit that referenced this pull request Oct 29, 2026
Rebased onto the x86_64 mapping (#1117), which now introduces the shared Register type and plumbing. Renames Aarch64Register to Arm64Register and drops Register::Unknown.

Co-Authored-By: Dr. Daniel Szokenstein <7881302+szokeasaurusrex@users.noreply.github.com>
@sentry-junior
sentry-junior Bot added this pull request to stack #1118 October 29, 2026 17:58
@sentry-junior
sentry-junior Bot marked this pull request as draft October 29, 2026 21:28

@szokeasaurusrex szokeasaurusrex 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.

To the extent that these suggestions are also applicable to the PR stacked on top of this one, apply them there as well

///
/// [psabi]: https://gitlab.com/x86-psabis/x86-64-ABI
pub enum Amd64Register {
Rax = { name: "rax", dwarf: 0 },

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.

Not 100% sure on this, but aren't these registers all prefixed with %?

Suggested change
Rax = { name: "rax", dwarf: 0 },
Rax = { name: "%rax", dwarf: 0 },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I left these without the %. The psABI's DWARF table prints every register through its \reg macro, which adds % because the document uses AT&T assembly syntax throughout. That % is an AT&T sigil rather than part of the register name: Intel syntax writes rax, gimli's X86_64 names have no prefix, and CpuFamily::Amd64.ip_register_name() returns rip. symbolic-cfi uses Breakpad's $rax, which is a separate convention again. No prefix also matches the AArch64 names (x0, sp). If you'd still like the % prefix, I can add it.

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.

I guess no prefix is most consistent then

Comment thread symbolic-common/src/register.rs Outdated
Comment thread symbolic-common/src/register.rs Outdated
Comment thread symbolic-common/src/register.rs Outdated
Comment thread symbolic-common/src/register.rs Outdated
Comment thread symbolic-debuginfo/src/base/variable.rs Outdated
Comment thread symbolic-symcache/src/v9/lookup.rs Outdated
sentry-junior Bot added a commit that referenced this pull request Oct 30, 2026
Rebased onto the x86_64 mapping (#1117), which now introduces the shared Register type and plumbing. Renames Aarch64Register to Arm64Register and drops Register::Unknown.

Co-Authored-By: Dr. Daniel Szokenstein <7881302+szokeasaurusrex@users.noreply.github.com>
Comment thread symbolic-common/src/register.rs Outdated
sentry-junior Bot added a commit that referenced this pull request Oct 30, 2026
Rebased onto the x86_64 mapping (#1117), which now introduces the shared Register type and plumbing. Renames Aarch64Register to Arm64Register and drops Register::Unknown.
Comment thread CHANGELOG.md Outdated
sentry-junior Bot added a commit that referenced this pull request Oct 30, 2026
Rebased onto the x86_64 mapping (#1117), which now introduces the shared Register type and plumbing. Renames Aarch64Register to Arm64Register and drops Register::Unknown.
@sentry-junior sentry-junior Bot changed the title feat!(variables): Register mapping DWARF <> x86_64 feat(variables): Register mapping DWARF <> x86_64 Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against aa8f4ac

@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review October 30, 2026 12:39
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.

[variables extraction] Proper Register Mapping for x86_64

2 participants