ermissions on bac Breakp oin ts and atc hp oin ts break 64257le line 64257le line set breakp oin at line um er in 64257le eg break mainc37 break 64257le func set breakp oin at func in 64257le break o64256set break o64256set set break at o64256set li ID: 11470
Download Pdf The PPT/PDF document "GDB QUICK REFERENCE GDB ersion Essen tia..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
GDBQUICKREFERENCEGDBVersion4EssentialCommandsgdbprogram[core]debugprogram[usingcoredumpcore]b[le:]functionsetbreakpointatfunction[inle]run[arglist]startyourprogram[witharglist]btbacktrace:displayprogramstackpexprdisplaythevalueofanexpressionccontinuerunningyourprogramnnextline,steppingoverfunctioncallssnextline,steppingintofunctioncallsStartingGDBgdbstartGDB,withnodebugginglesgdbprogrambegindebuggingprogramgdbprogramcoredebugcoredumpcoreproducedbyprogramgdb--helpdescribecommandlineoptionsStoppingGDBquitexitGDB;alsoqorEOF(egC-d)INTERRUPT(egC-c)terminatecurrentcommand,orsendtorunningprocessGettingHelphelplistclassesofcommandshelpclassone-linedescriptionsforcommandsinclasshelpcommanddescribecommandExecutingyourProgramrunargliststartyourprogramwitharglistrunstartyourprogramwithcurrentargumentlistrun:::infoutfstartyourprogramwithinput,outputredirectedkillkillrunningprogramttydevusedevasstdinandstdoutfornextrunsetargsarglistspecifyarglistfornextrunsetargsspecifyemptyargumentlistshowargsdisplayargumentlistshowenvshowallenvironmentvariablesshowenvvarshowvalueofenvironmentvariablevarsetenvvarstringsetenvironmentvariablevarunsetenvvarremovevarfromenvironmentShellCommandscddirchangeworkingdirectorytodirpwdPrintworkingdirectorymake:::call\make"shellcmdexecutearbitraryshellcommandstring[]surroundoptionalarguments:::showoneormoreargumentsc\r1998FreeSoftwareFoundation,Inc.PermissionsonbackBreakpointsandWatchpointsbreak[le:]lineb[le:]linesetbreakpointatlinenumber[inle]eg:breakmain.c:37break[le:]funcsetbreakpointatfunc[inle]break+osetbreak-osetsetbreakatosetlinesfromcurrentstopbreak*addrsetbreakpointataddressaddrbreaksetbreakpointatnextinstructionbreak:::ifexprbreakconditionallyonnonzeroexprcondn[expr]newconditionalexpressiononbreakpointn;makeunconditionalifnoexprtbreak:::temporarybreak;disablewhenreachedrbreakregexbreakonallfunctionsmatchingregexwatchexprsetawatchpointforexpressionexprcatcheventbreakatevent,whichmaybecatch,throw,exec,fork,vfork,load,orunload.infobreakshowdenedbreakpointsinfowatchshowdenedwatchpointscleardeletebreakpointsatnextinstructionclear[le:]fundeletebreakpointsatentrytofun()clear[le:]linedeletebreakpointsonsourcelinedelete[n]deletebreakpoints[orbreakpointn]disable[n]disablebreakpoints[orbreakpointn]enable[n]enablebreakpoints[orbreakpointn]enableonce[n]enablebreakpoints[orbreakpointn];disableagainwhenreachedenabledel[n]enablebreakpoints[orbreakpointn];deletewhenreachedignorencountignorebreakpointn,counttimescommandsn[silent]command-listexecuteGDBcommand-listeverytimebreakpointnisreached.[silentsuppressesdefaultdisplay]endendofcommand-listProgramStackbacktrace[n]bt[n]printtraceofallframesinstack;orofnframes|innermostifn0,outermostifnframe[n]selectframenumbernorframeataddressn;ifnon,displaycurrentframeupnselectframenframesupdownnselectframenframesdowninfoframe[addr]describeselectedframe,orframeataddrinfoargsargumentsofselectedframeinfolocalslocalvariablesofselectedframeinforeg[rn]:::infoall-reg[rn]registervalues[forregsrn]inselectedframe;all-regincludes\roatingpointExecutionControlcontinue[count]c[count]continuerunning;ifcountspecied,ignorethisbreakpointnextcounttimesstep[count]s[count]executeuntilanotherlinereached;repeatcounttimesifspeciedstepi[count]si[count]stepbymachineinstructionsratherthansourcelinesnext[count]n[count]executenextline,includinganyfunctioncallsnexti[count]ni[count]nextmachineinstructionratherthansourcelineuntil[location]rununtilnextinstruction(orlocation)finishrununtilselectedstackframereturnsreturn[expr]popselectedstackframewithoutexecuting[settingreturnvalue]signalnumresumeexecutionwithsignals(noneif0)jumplinejump*addressresumeexecutionatspeciedlinenumberoraddresssetvar=exprevaluateexprwithoutdisplayingit;useforalteringprogramvariablesDisplayprint[/f][expr]p[/f][expr]showvalueofexpr[orlastvalue$]accordingtoformatf:xhexadecimaldsigneddecimaluunsigneddecimalooctaltbinaryaaddress,absoluteandrelativeccharacterf\roatingpointcall[/f]exprlikeprintbutdoesnotdisplayvoidx[/Nuf]exprexaminememoryataddressexpr;optionalformatspecfollowsslashNcountofhowmanyunitstodisplayuunitsize;oneofbindividualbyteshhalfwords(twobytes)wwords(fourbytes)ggiantwords(eightbytes)fprintingformat.Anyprintformat,orsnull-terminatedstringimachineinstructionsdisassem[addr]displaymemoryasmachineinstructionsAutomaticDisplaydisplay[/f]exprshowvalueofexpreachtimeprogramstops[accordingtoformatf]displaydisplayallenabledexpressionsonlistundisplaynremovenumber(s)nfromlistofautomaticallydisplayedexpressionsdisabledispndisabledisplayforexpression(s)numbernenabledispnenabledisplayforexpression(s)numberninfodisplaynumberedlistofdisplayexpressions ExpressionsexpranexpressioninC,C++,orModula-2(includingfunctioncalls),or:addr@lenanarrayoflenelementsbeginningataddrle::nmavariableorfunctionnmdenedinleftypegaddrreadmemoryataddrasspeciedtype$mostrecentdisplayedvalue$nnthdisplayedvalue$$displayedvaluepreviousto$$$nnthdisplayedvaluebackfrom$$lastaddressexaminedwithx$valueataddress$$varconveniencevariable;assignanyvalueshowvalues[n]showlast10values[orsurrounding$n]showconvdisplayallconveniencevariablesSymbolTableinfoaddresssshowwheresymbolsisstoredinfofunc[regex]shownames,typesofdenedfunctions(all,ormatchingregex)infovar[regex]shownames,typesofglobalvariables(all,ormatchingregex)whatis[expr]ptype[expr]showdatatypeofexpr[or$]withoutevaluating;ptypegivesmoredetailptypetypedescribetype,struct,union,orenumGDBScriptssourcescriptread,executeGDBcommandsfromlescriptdefinecmdcommand-listcreatenewGDBcommandcmd;executescriptdenedbycommand-listendendofcommand-listdocumentcmdhelp-textcreateonlinedocumentationfornewGDBcommandcmdendendofhelp-textSignalshandlesignalactspecifyGDBactionsforsignal:printannouncesignalnoprintbesilentforsignalstophaltexecutiononsignalnostopdonothaltexecutionpassallowyourprogramtohandlesignalnopassdonotallowyourprogramtoseesignalinfosignalsshowtableofsignals,GDBactionforeachDebuggingTargetstargettypeparamconnecttotargetmachine,process,orlehelptargetdisplayavailabletargetsattachparamconnecttoanotherprocessdetachreleasetargetfromGDBcontrolControllingGDBsetparamvaluesetoneofGDB'sinternalparametersshowparamdisplaycurrentsettingofparameterParametersunderstoodbysetandshow:complaintlimitnumberofmessagesonunusualsymbolsconfirmon/oenableordisablecautionaryquerieseditingon/ocontrolreadlinecommand-lineeditingheightlppnumberoflinesbeforepauseindisplaylanguagelangLanguageforGDBexpressions(auto,cormodula-2)listsizennumberoflinesshownbylistpromptstrusestrasGDBpromptradixbaseoctal,decimal,orhexnumberrepresentationverboseon/ocontrolmessageswhenloadingsymbolswidthcplnumberofcharactersbeforelinefoldedwriteon/oAlloworforbidpatchingbinary,coreles(whenreopenedwithexecorcore)history:::h:::groupswiththefollowingoptions:hexpo/ondisable/enablereadlinehistoryexpansionhfilelenameleforrecordingGDBcommandhistoryhsizesizenumberofcommandskeptinhistorylisthsaveo/oncontroluseofexternalleforcommandhistoryprint:::p:::groupswiththefollowingoptions:paddresson/oprintmemoryaddressesinstacks,valuesparrayo/oncompactorattractiveformatforarrayspdemanglon/osource(demangled)orinternalformforC++symbolspasm-demon/odemangleC++symbolsinmachine-instructionoutputpelementslimitnumberofarrayelementstodisplaypobjecton/oprintC++derivedtypesforobjectspprettyo/onstructdisplay:compactorindentedpunionon/odisplayofunionmemberspvtblo/ondisplayofC++virtualfunctiontablesshowcommandsshowlast10commandsshowcommandsnshow10commandsaroundnumbernshowcommands+shownext10commandsWorkingFilesfile[le]useleforbothsymbolsandexecutable;withnoarg,discardbothcore[le]readleascoredump;ordiscardexec[le]useleasexecutableonly;ordiscardsymbol[le]usesymboltablefromle;ordiscardloadledynamicallylinkleandadditssymbolsadd-symleaddrreadadditionalsymbolsfromle,dynamicallyloadedataddrinfofilesdisplayworkinglesandtargetsinusepathdirsadddirstofrontofpathsearchedforexecutableandsymbollesshowpathdisplayexecutableandsymbollepathinfosharelistnamesofsharedlibrariescurrentlyloadedSourceFilesdirnamesadddirectorynamestofrontofsourcepathdirclearsourcepathshowdirshowcurrentsourcepathlistshownexttenlinesofsourcelist-showprevioustenlineslistlinesdisplaysourcesurroundinglines,speciedas:[le:]numlinenumber[innamedle][le:]functionbeginningoffunction[innamedle]+oolinesafterlastprinted-oolinesprevioustolastprinted*addresslinecontainingaddresslistf,lfromlineftolinelinfolinenumshowstarting,endingaddressesofcompiledcodeforsourcelinenuminfosourceshownameofcurrentsourceleinfosourceslistallsourcelesinuseforwregexsearchfollowingsourcelinesforregexrevregexsearchprecedingsourcelinesforregexGDBunderGNUEmacsM-xgdbrunGDBunderEmacsC-hmdescribeGDBmodeM-ssteponeline(step)M-nnextline(next)M-isteponeinstruction(stepi)C-cC-fnishcurrentstackframe(finish)M-ccontinue(cont)M-uupargframes(up)M-ddownargframes(down)C-x©numberfrompoint,insertatendC-xSPC(insourcele)setbreakatpointGDBLicenseshowcopyingDisplayGNUGeneralPublicLicenseshowwarrantyThereisNOWARRANTYforGDB.Displayfullno-warrantystatement.Copyrightc\r1991,'92,'93,'98FreeSoftwareFoundation,Inc.RolandH.PeschTheauthorassumesnoresponsibilityforanyerrorsonthiscard.ThiscardmaybefreelydistributedunderthetermsoftheGNUGeneralPublicLicense.Pleasecontributetodevelopmentofthiscardbyannotatingit.Improvementscanbesenttobug-gdb@gnu.org.GDBitselfisfreesoftware;youarewelcometodistributecopiesofitunderthetermsoftheGNUGeneralPublicLicense.ThereisabsolutelynowarrantyforGDB.