Derek Parker 50c3bbcb93
proc: support debugging stripped non-Go binaries (#4263)
* proc: support debugging non-Go binaries that dlopen Go shared libraries

Add support for debugging non-Go stub binaries that dynamically load Go
shared libraries via dlopen or other dynamic linkage modes. When the
initial binary has no Go runtime symbols or DWARF info, Delve now marks
it as non-Go and defers Go-specific initialization. A breakpoint on the
dynamic linker's _dl_debug_state function detects shared library loads,
allowing Delve to pick up Go debug info when a Go .so is loaded at
runtime.

* proc: address PR review feedback for non-Go binary debugging

- Deduplicate auxv parsing by extracting searchAuxv helper
- Rename IsNonGo to IsGo (positive flag is easier to reason about)
- Move Go image detection into loadDebugInfoMaps to avoid reparsing
  debug_info; uses DW_AT_language == DW_LANG_Go which is already
  checked there for cu.isgo
- Remove hasGoProducer function (no longer needed)
- Remove pkg/proc import from pkg/terminal/command.go; use string
  literal for stop reason comparison instead
- Update CLAUDE.md with DWARF parsing and layer boundary guidance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 15:05:11 +01:00
..