Skip to content

Dwarf2 now supports ARM for LAVA#1619

Merged
lacraig2 merged 1 commit intodevfrom
dwarf-arm
Jan 15, 2026
Merged

Dwarf2 now supports ARM for LAVA#1619
lacraig2 merged 1 commit intodevfrom
dwarf-arm

Conversation

@AndrewQuijano
Copy link
Copy Markdown
Collaborator

@AndrewQuijano AndrewQuijano commented Dec 6, 2025

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

This pull request aims to grant dwarf2 support for ARM. Allowing this support would allow for LAVA to inject bugs into the ARM architecture, see here


ARM
Once I built the executable, I used the following command. readelf --debug-dump=info test_hc_arm | grep "DW_OP_reg"

image

To confirm that I should not use the aliases, and just stick register numbers, use the command readelf --debug-dump=frames test_hc_aarch64 | grep -E "RA|CFA"

image

To confirm the macros are identical for i386, I confirmed they both use LSB and are 32-bits.

image

AARCH64
Once I built the executable, I used the following command. readelf --debug-dump=info test_hc_aarch64 | grep "DW_OP_reg"

image

To confirm that I should not use the aliases, and just stick register numbers, use the command readelf --debug-dump=frames test_hc_aarch64 | grep -E "RA|CFA"

image

To confirm that ELFCLASS64 and ELFDATA2LSB are correct macros, refer to the screenshots, which show both as 64-bit and LSB-first. Additionally, the update now supports EM_AARCH64, which aligns with the AARCH64 machine architecture.

image

...

Test plan

Additionally, I followed the guidance provided here on setting registers and mapping.

https://github.com/panda-re/panda/blob/dev/panda/python/core/pandare/arch.py

I did test using dwarfdump.py on dwarf dump output from AARCH/ARM, and that explains the fixes. But given the static code analysis, it is likely the registers would map correctly on AARCH64 for LAVA.

The test would really be testable once ARM/AARCH64 hypercalls are fixed.
...

Closing issues

...

@AndrewQuijano AndrewQuijano changed the title Dwarf2 now supports ARM Dwarf2 now supports ARM for LAVA Dec 6, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds ARM architecture support (both 32-bit ARM and 64-bit AARCH64) to the dwarf2 plugin, enabling LAVA bug injection for ARM targets. The changes restructure the existing x86-specific code to be architecture-agnostic and add comprehensive ARM register mappings.

Key changes:

  • Added DWARF register name mappings and register index mappings for ARM (32-bit) and AARCH64 (64-bit)
  • Reorganized architecture-specific preprocessor directives to support all four architectures: i386, x86_64, ARM, and AARCH64
  • Updated ELF architecture detection to recognize ARM and AARCH64 binaries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lacraig2 lacraig2 merged commit 6b89731 into dev Jan 15, 2026
3 checks passed
@lacraig2 lacraig2 deleted the dwarf-arm branch January 15, 2026 17:16
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.

3 participants