../

MGF

  • Make gf2 work on MacOS
  • If that doesn’t work try to create a new SwiftUI app that works with LLDB instead of GDB
  • As of 2025-12-27 I haven’t been able to get gcc to generate proper debugging symbols.
  • Any binary compiled with -g throws up the following error

❌️ DWARF Error: DW_FORM_line_strp used without required section

  • The problem persists even when using -gdrawf-4
  • Meanwhile clang with -gdrawf-4 solves the symbol problem but gdb is not able to execute it for some reason

As of 2025-12-27 gdb cannot debug aarch64-darwin binaries.

Even the formula to build gdb has to use a workaround.

# Fix: Apple Silicon build, this is only way to build native GDB
if OS.mac? && Hardware::CPU.arm?
  # Workaround: "--target" must be "faked"
  args << "--target=x86_64-apple-darwin20"
  args << "--program-prefix="
end

They fake it to build of x86_64. This produces a gdb binary that runs natively on Apple Silicon but cannot debug any aarch-darwin code. Though it can be used for remote debugging.

Moving forward, use lldb for anything related to MacOS.