Skip to content

Conversation

@hugsy
Copy link
Owner

@hugsy hugsy commented Jul 22, 2023

Description/Motivation/Screenshots

Fixes ARM and ARM64 NOP instructions

Fixes an off-by-one in gdb_get_nth_next_instruction_address() for fixed-size instruction archs.

Result: nop works fine on ARM/AARCH64

image

Against which architecture was this tested ?

"Tested" indicates that the PR works and the unit test (see docs/testing.md) run passes without issue.

  • x86-32
  • x86-64
  • ARM
  • AARCH64
  • MIPS
  • POWERPC
  • SPARC
  • RISC-V

Checklist

  • My PR was done against the dev branch, not main.
  • My code follows the code style of this project.
  • My change includes a change to the documentation, if required.
  • If my change adds new code, adequate tests have been added.
  • I have read and agree to the CONTRIBUTING document.

@hugsy hugsy changed the title Fix nop insns Fix hardcoded NOP instructions for ARM/AARCH64 Jul 22, 2023
@hugsy hugsy marked this pull request as ready for review July 22, 2023 01:38
@hugsy hugsy added this to the 2023.08 milestone Jul 22, 2023
@github-actions
Copy link

🤖 Coverage Update

  • Commit: f6c149c
  • Current Coverage: 71.6013%
  • New Coverage: 71.5983%
  • Diff: -0.0030000000000001137

arch = frame.architecture()

for insn in arch.disassemble(start_pc, **kwargs):
assert isinstance(insn["addr"], int)
Copy link
Owner Author

@hugsy hugsy Jul 22, 2023

Choose a reason for hiding this comment

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

those asserts are mostly for pylance, as the gdb.pyi simply uses a dict[str, object] for instruction

@hugsy hugsy merged commit 0461d6f into dev Jul 22, 2023
@hugsy hugsy deleted the fix_nop_insns branch July 22, 2023 23:31
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