gdb fails with “Unable to find Mach task port for process-id” error

后端 未结 12 2046
青春惊慌失措
青春惊慌失措 2020-11-28 19:02

My app runs fine but gdb fails to debug it with the following error

(gdb) run
Starting program: /path/to/app 
Unable to find Mach task port for process-id 83         


        
12条回答
  •  粉色の甜心
    2020-11-28 19:31

    The problem is that you are not logged in as a root user (which you don't want). You need to create a certificate for gdb to be allowed access. Follow this tutorial and you should be good to go...

    http://sourceware.org/gdb/wiki/BuildingOnDarwin

    If all else fails, just use: sudo gdb executableFileName

提交回复
热议问题