资源描述:
《A Machine-Independent Debugger英文》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、SOFTWARE
2、PRACTICEANDEXPERIENCE,VOL.26(11),1277{1299(NOVEMBER1996)AMachine-IndependentDebuggerDAVIDR.HANSONANDMUKUNDRAGHAVACHARIDepartmentofComputerScience,PrincetonUniversity,35OldenStreet,Princeton,NJ08544U.S.A.(email:fdrh,mrmg@cs.princeton.edu)SUMMARYcdbisasimple,source-leveldebuggerforAN
3、SI/ISOCprogramscompiledbylcc,aretargetableCcompiler.cdbiscompletelyindependentofitstargetarchitecture.Thisindependenceisachievedbyembeddingasmallamountofitself
4、a`nub'
5、inthepro-gramtobedebuggedandbyhavingthecompileremitmachine-independentsymbol-tabledataandrelatedcode.Thispaperdescribesthede
6、signofanubinterfacefordebugging,atarget-independentimplementationofthisinterfaceforcdb,andtheimplementationofcdbitself.Whencomparedtoplatform-specicdebuggers,cdb'simplementationisminuscule:thenub,debugger,andassociatedcommunicationsroutinestakeabout1500linesofC,andfewerthan600lineswereadde
7、dtolcc'sfrontendtoemitsymboltablesandbreakpointhooks.Allthiscodeismachineindependent.KEYWORDSdebuggers;retargetablecompilers;programmingenvironments;lccINTRODUCTIONSource-leveldebuggersarenotoriouslymachine-dependentprograms.Mostdebuggersdependnotonlyonthemachineonwhichtheyrun,butalsodepend
8、onthecompil-ers,linkers,andoperatingsystemswithwhichtheycollaborate.Thesedependenciesusuallyinvolvearcanedataformats,complicatedprotocols,orobscureandevenun-documentedsystemcalls.Debuggersdependoncompilersbecausecompilersandlinkersgeneratethesym-boltablesandobjectcodethatdebuggersmustreadto
9、interpretuserinput,displaysource-levelvalues,andtondsource-codelocations.Debuggersdependonmachinearchitecturesbecausemostdebuggersusehardware-specicfacilitiesforimplement-ingbreakpointsandsinglestepping.Debuggersdependonoperatingsystemsbecausedebuggersmustarrangetoaccesstheaddressspaceoft
10、heprogrambeingdebugged
11、thetarget
12、andtheymustcontrolthetarget'sexecution.Thesituationisevenmorecomplicatedindebuggersforconcurrentlanguages.Buildingasource-leveldebuggerforanewmachine,evenforanexistinglanguage,isacomplexandtime-consumingprocessthatcaneasi