[macos] gdb fails with "Unable to find Mach task port for process-id" error

Following the instructions here Codesign gdb on macOS seemed to resolve this issue, for me, on macOS High Sierra (10.13.3).