Current location - Quotes Website - Signature design - How to install gdb debugger in Mac system
How to install gdb debugger in Mac system
Install gdb 1 first. Before installing gdb, you should first configure the installation management tools of homebrew. Because you have written the detailed installation process of Homebrew (please refer to my previous experience), after installing Homebrew, enter the following command to see if there is a gdb installation package in Homebrew. As you can see, there is no GDB installation package in the current version. 3 Enter the command brew update to update the homebrew software library. After the update is completed, query again to see that there is already a gdb installation package. 4 enter the command brew install gdb to install the gdb debugger. The installation process is as follows. 5 After the installation is completed, you can test the gdb version and whether it is installed correctly by entering gdb. In addition, it is suggested that you install CGDB or DDD debugging tools through the above installation method, which are also based on GDB, but have the advantage of convenient interface debugging. 7 You may find that after the installation, you still can't use GDB for code debugging, and the following errors will occur: mach task port of process-ID 6603 cannot be found: (OS/kern) failed (0x5). (Please check that GDB is a collaborative design-see Task Gating (8)) Next step. . . GDB also needs to be signed by a certificate to be used normally. End 2. Create a certificate for GDB 1 Open Keychain Access Tool on your mac and create Certificate 2. The information of the certificate can refer to Figure 3 below. Then click the Continue button until the figure below, and change it to the corresponding setting of System, and finally generate the certificate as shown in the figure below. Follow these steps to change the authorization of the certificate to Always Trust. Third, sign the certificate to open the terminal, and enter the following command: code sign-syc _ gdb _ cert/usr/local/bin/gdb to open the task manager and close the process taskgated in the CPU tab. Then you can debug the code through GDB.