Cov txheej txheem:

Kuv yuav siv GDB ntawm Windows li cas?
Kuv yuav siv GDB ntawm Windows li cas?

Video: Kuv yuav siv GDB ntawm Windows li cas?

Video: Kuv yuav siv GDB ntawm Windows li cas?
Video: Dej Sab Si (Maiv Ntxawm Tsab) - Koj Tsuas Muaj Nqis Ntawm Kuv - 2011 2024, Hlis ntuj nqeg
Anonim

Pib GDB

Hauv qhov rais hais kom ua console, ntaus arm-tsis muaj-eabi- gdb ib thiab nias Enter. Koj tuaj yeem ua qhov no los ntawm txhua daim ntawv teev npe. Yog tias koj tsis paub yuav ua li cas qhib lub Qhov rai hais kom ua console, saib Khiav OpenOCD rau Qhov rai . Koj tuaj yeem ua tau khiav GDB ncaj qha los ntawm " Khiav "hauv Start menu.

Ntawm no, kuv yuav siv GDB li cas?

Yuav Ua Li Cas Debug C Program siv gdb hauv 6 Cov kauj ruam yooj yim

  1. Sau cov C program nrog debugging xaiv -g. Sau koj C program nrog -g xaiv.
  2. Tua tawm gdb. Tua tawm C debugger (gdb) raws li qhia hauv qab no.
  3. Teem lub point so hauv C program.
  4. Ua qhov C program hauv gdb debugger.
  5. Luam tawm cov nqi sib txawv hauv gdb debugger.
  6. Txuas ntxiv mus, hla dhau thiab hauv - gdb cov lus txib.

Kuv yuav ua li cas thiaj paub tias GDB raug teeb tsa? Nruab GDB Koj ua tau xyuas seb GDB raug teeb tsa ntawm koj lub PC nrog cov lus txib nram qab no. Yog GDB tsis yog ntsia ntawm koj lub PC, nruab nws siv koj tus neeg saib xyuas pob (apt, pacman, emerge, thiab lwm yam). GDB muaj nyob rau hauv MinGW. Yog koj siv pob manager Scoop ntawm Windows, GDB tau teeb tsa thaum koj nruab gcc s cog nruab gcc ua.

Ib tug kuj yuav nug, Kuv yuav teeb tsa GDB li cas?

  1. Nruab pre-built gdb binaries los ntawm kev txheeb xyuas cov ntaub ntawv xa tawm. Koj tuaj yeem nruab gdb ntawm Debian-raws li linux distro (xws li Ubuntu, Mint, thiab lwm yam) los ntawm cov lus txib nram qab no. $ sudo apt-tau hloov tshiab.
  2. Download tau qhov chaws ntawm GDB, sau nws thiab nruab. Ua raws li hauv qab no hais cov kauj ruam los suav GDB los ntawm kos thiab nruab nws.

GDB tool yog dab tsi?

GDB stands rau GNU Project Debugger thiab yog ib tug haib debugging cuab yeej rau C (nrog rau lwm yam lus zoo li C ++). Nws pab koj mus ncig hauv koj C cov kev pab cuam thaum lawv tab tom ua thiab tseem tso cai rau koj pom tias muaj dab tsi tshwm sim thaum koj qhov kev pab cuam poob. Mus rau koj lub Linux hais kom sai thiab ntaus gdb ib ”.

Pom zoo: