Skip to content

Enable GDB for binutils 2.40 with native AmigaOS debugging fixesDerfsss binutils gdb - #39

Open
migthymax wants to merge 4 commits into
ppc-amigaosfrom
derfsss-binutils-gdb
Open

migthymax wants to merge 4 commits into
ppc-amigaosfrom
derfsss-binutils-gdb

Conversation

@migthymax

Copy link
Copy Markdown
Member

Created A PR from derfsss RP on adtools with the changes towards the binutils-gdb source repo.

walkero-gr and others added 2 commits April 19, 2026 13:59
Register handling:
- Fix fetch_registers() GPR loop using loop index instead of -1
- Fix FPR index offset (subtract base register number)
- Fix loop bounds: 32 registers not 31
- Gate AltiVec register access on ECF_VECTOR context flag
- Implement store_registers() using IDebug->WriteTaskContext()

Trap/signal handling:
- Replace raw PPC vector numbers with SDK TRAPNUM_* values from
  exec/interrupts.h (ExceptionContext.Traptype uses these)
- Add handling for TRAP_TRAP (breakpoints), TRAP_DATA_BREAKPOINT
  (DABR), TRAP_INST_BREAKPOINT, TRAP_TRACE (single-step)
- Preserve actual signal type in wait() instead of collapsing
  SEGV/BUS/FPE/ILL/ALRM to generic GDB_SIGNAL_0

Process control:
- Implement attach() - find task by name/address, suspend, install
  debug hook
- Fix kill() - use Signal(SIGBREAKF_CTRL_C) + RestartTask instead
  of DeleteTask on Process objects

Message pool safety:
- Add NULL check to alloc_message() with Forbid/Permit guards
- Add Forbid/Permit to free_message() for consistency
- Add NULL checks to all alloc_message() calls in debug callback

BFD file path fix:
- Skip canonicalize_file_name() on AmigaOS in gdb_realpath()
- AmigaOS realpath() resolves assigns (T: -> "RAM Disk:T/") and
  volume names (SYS: -> "AmigaOS:") producing paths that fail
  when BFD's file cache tries to reopen them

Minor cleanup:
- Fix typos in comments
- Use gdbarch register numbers consistently
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.

4 participants