Ho un errore durante il debug di un programma C in NetBeans.
GDB has unexpectedly stopped with return 127
Ecco uno screenshot degli strumenti di creazione:
Questo è quello che ho fatto per installare GDB (sotto Yosemite):
Installa brew : link
Aggiorna brew . Se hai già installato brew , controlla gli aggiornamenti. Nel terminale:
$ brew update
Questo passaggio è risultato decisivo per me poiché, prima dell'aggiornamento, brew non ha trovato alcun pacchetto gdb :
$ brew install gdb # Error: No available formula for gdb
E dopo quello:
$ brew update
$ brew search | grep gdb # cgdb gdb gdbm pgdbf
$ brew install gdb
Creating a certificate
Start Keychain Access application (
/Applications/Utilities/Keychain Access.app)Open menu
/Keychain Access/Certificate Assistant/Create a Certificate...Choose a name (
gdb-certin the example), setIdentity TypetoSelf Signed Root, setCertificate TypetoCode Signingand select theLet me override defaults. Click several times onContinueuntil you get to theSpecify a Location For The Certificatescreen, then setKeychaintoSystem.If you can't store the certificate in the
Systemkeychain, create it in theloginkeychain, then exported it. You can then imported it into theSystemkeychain.Finally, using the contextual menu for the certificate, select
Get Info, open theTrustitem, and setCode SigningtoAlways Trust.You must quit Keychain Access application in order to use the certificate and restart
taskgatedservice by killing the current running taskgated process (comment: for example withsudo pkill taskgatedor restarting).
E poi
Giving gdb permission to control other processes
If the certificate is known as
gdb-cert, just use:$ codesign -s gdb-cert gdbComment: if
gdbis not found, then add the path where it was installed. In my case:$ codesign -s gdb-cert /usr/local/Cellar/gdb/7.10/bin/gdb
gdb o il percorso in cui è stato installato gdb (ad esempio /usr/local/Cellar/gdb/7.10/bin/gdb ) nel menu /Netbeans/Preferences/C/C++/Build Tools campo Debugger Command field .