ghidra icon indicating copy to clipboard operation
ghidra copied to clipboard

6805: JSR calls include erroneous write references to the stack

Open philpem opened this issue 2 months ago • 0 comments

Describe the bug When double-clicking the target in a JSR (jump subroutine) instruction's target operand, an Operand References window appears, showing a reference to the stack (address 0xFE) and one to the target function/subroutine.

This doesn't happen on other processor types; it causes a usability issue where functions are harder to follow. Ideally the stack write should be hidden in some way, or otherwise ignored by Ghidra.

To Reproduce Steps to reproduce the behavior:

  1. Disassemble a binary for the 6805 which includes JSR (e.g. CD 05 B8 opcode) and RTS (XX opcode) instructions.
  2. Scroll down to a JSR instruction and double click the target operand.
  3. Note that the References screen pops up, showing a write to the stack address, and the target jump.
  4. See error

Expected behavior Same behaviour as other processor types; stack pushes/pops are not included in the reference list, and function calls can simply be double-clicked to follow them to the target.

Screenshots image image

Environment (please complete the following information):

  • OS: Linux Mint 21.3 "Virginia"
  • Java Version: 17.0.10
  • Ghidra Version: 11.1 DEV, 2024-Feb-23
  • Ghidra Origin: Locally built from Git HEAD

philpem avatar Apr 23 '24 16:04 philpem