·¢ÐÅÈË: lhh.bbs@argo.zsu.edu.cn (ÒÐÌì), ÐÅÇø: cnunix
±ê Ìâ: GDB (8) Part Five(ת¼Ä)
·¢ÐÅÕ¾: Yat-sen Channel BBS (Wed Jul 29 21:49:45 1998)
תÐÅÕ¾: Lilac!ustcnews!news.zsu.edu.cn!argo
³ö ´¦: argo.zsu.edu.cn
¶ÏµãÌõ¼þ
===========
×î¼òµ¥µÄ¶Ïµã¾ÍÊǵ±ÄãµÄ³ÌÐòÿ´ÎÖ´Ðе½µÄʱºò¾Í¼òµ¥½«³ÌÐò¹ÒÆð¡£ÄãÒ²¿ÉÒÔΪ¶Ïµã
ÉèÖá°Ìõ¼þ¡±¡£Ìõ¼þÖ»ÊÇÄãËùʹÓõıà³ÌÓïÑÔµÄÒ»¸ö²¼¶û±í´ïʽ£¬´øÓÐÌõ¼þ±í´ïʽµÄ¶Ïµã
ÔÚÿ´ÎÖ´ÐÐʱÅжϼÆËã±í´ïʽµÄÖµ£¬µ±±í´ïʽֵΪÕæʱ²Å¹ÒÆð³ÌÐò¡£
ÕâÊÇʹÓá°¶ÏÑÔ¡±µÄÒ»ÖÐÐÎʽ£¬ÔÚÕâÖÖÐÎʽÖÐÄãÖ»ÓÐÔÚ¶ÏÑÔΪÕæʱ²Å¹ÒÆð³ÌÐò¡£Èç¹û
ÔÚCÓïÑÔÖÐÄãҪʹ¶ÏÑÔΪ¼Ùʱ¹ÒÆð³ÌÐòÔòʹÓ㺡°!±í´ïʽ¡±¡£
Ìõ¼þ±í´ïʽ¶Ô¹Û²ìµãҲͬÑùÓÐЧ£¬µ«Äã²¢²»ÐèÒªËü£¬ÒòΪ¹Û²ìµã±¾Éí¾Í¼ÆËãÒ»¸ö±í´ïʽ¡
£
µ«ËüÒ²Ðí»á¼òµ¥Ò»Ð©¡£±ÈÈçÖ»ÔÚÒ»¸ö±äÁ¿ÃûÉÏÉèÖù۲ìµãÈ»ºóÉèÖÃÒ»¸öÌõ¼þÀ´²âÊÔеĸ³
Öµ¡£
¶ÏµãÌõ¼þ¿ÉÄÜÓи±×÷ÓÃ(side effects)»áÓ°Ïì³ÌÐòµÄÔËÐС£ÕâÒ»µãÓÐʱҲÊǺÜÓÐÓõÄ
±ÈÈçÀ´¼¤»îÒ»¸öÏÔʾ³ÌÐòÍê³ÉÇé¿öµÄµÄº¯Êý£¬»òʹÓÃÄã×Ô¼ºµÄ´òÓ¡º¯ÊýÀ´¸ñʽ»¯ÌØÊâµÄ
Êý¾Ý½á¹¹¡£µ±ÔÚͬһλÖÃûÓÐÁíÒ»¸ö¶ÏµãÉèÖÃʱ£¬½á¹ûÊÇ¿ÉÔ¤¼ûµÄ¡£(ÔÚgdbÖÐÈç¹ûÔÚͬһ
¸öµØ·½Ê¹ÓÃÁËÒ»¸ö¶ÏµãºÍÒ»¸öÌõ¼þ¶ÏµãÔòÆÕͨ¶Ïµã¿ÉÄÜÏȱ»¼¤»î¡£)ÔÚÌõ¼þ¶ÏµãµÄÓ¦ÓÃÉÏ
Óкܶ༼ÇÉ¡£
¶ÏµãÌõ¼þ¿ÉÒÔÔÚÉèÖöϵãµÄͬʱ±»ÉèÖá£Ê¹ÓÃ'if'ÃüÁî×÷Ϊ'break'ÃüÁîµÄ²ÎÊý¡£¶Ïµã
Ìõ¼þÒ²¿ÉÒÔÔÚÈκÎʱºòʹÓÃ'condition'ÃüÁîÀ´ÉèÖá£'watch'ÃüÁî²»ÄÜÒÔ'if'×÷Ϊ²ÎÊý
ËùÒÔʹÓÃ'condition'ÃüÁîÊÇÔÚ¹Û²ìµãÉÏÉèÖÃÌõ¼þµÄΨһ·½·¨¡£
`condition BNUM EXPRESSION'
°Ñ'EXPRESSIN'×÷Ϊ¶ÏµãÌõ¼þ¡£¶ÏµãÓÃ'BNUM'À´Ö¸¶¨¡£ÔÚÄãΪBNUMºÅ¶ÏµãÉèÖÃÁËÌõ¼þ
ºó£¬Ö»ÓÐÔÚÌõ¼þΪÕæʱ³ÌÐò²Å±»ÔÝÍ£¡£µ±ÄãʹÓÃ'condition'ÃüÁîGDBÂíÉÏͬ²½µÄ¼ì²é
'EXPRESSION'µÄÖµÅжϱí´ïʽÖеķûºÅÔڶϵ㴦ÊÇ·ñÓÐЧ£¬µ«GDB²¢²»ÕæÕý¼ÆËã±í´ïʽ
掙歜
`condition BNUM'
ɾ³ýÔÚ'BNUM'ºÅ¶Ïµã´¦µÄÌõ¼þ¡£Ê¹Ö®³ÉΪһ¸öÆÕͨ¶Ïµã¡£
Ò»¸öÌõ¼þ¶ÏµãµÄÌØÊâÀý×ÓÊÇʱһ¸ö³ÌÐòÔÚÖ´ÐÐÁËij¾äÓï¾äÈô¸É´ÎºóÍ£Ö¹¡£ÓÉÓÚÕâ
¸ö¹¦Äܷdz£³£Óã¬Äã¿ÉÒÔʹÓÃÒ»¸öÃüÁîÀ´Ö±½ÓÉèÖÃËüÄǾÍÊÇ'ignore count'¡£Ã¿¸ö
¶Ïµã¶¼ÓÐ'ignore count'£¬È±Ê¡ÊÇÁã¡£Èç¹û'ignore count'ÊÇÕýµÄÄÇôÄãµÄ³ÌÐòÔÚ
ÔËÐйý¶Ïµã´¦'count'´Îºó±»ÔÝÍ£¡£
`ignore BNUM COUNT'
ÉèÖõÚBNUMºÅ¶ÏµãµÄ'ignore count'Ϊ'COUNT'¡£
Èç¹ûÒªÈöϵãÔÚÏ´ÎÖ´Ðе½Ê±¾ÍÔÝÍ£³ÌÐò£¬ÄÇô°Ñ'COUNT'ÉèΪ0.
µ±ÄãʹÓÃ'continue'ÃüÁîÀ´¼ÌÐøÄã³ÌÐòµÄÖ´ÐÐʱ£¬Äã¿ÉÒÔÖ±½Ó°Ñ'ignore count'
×÷Ϊ'continue'µÄ²ÎÊýʹÓá£ÄãÖ»ÒªÖ±½ÓÔÚ'continue'ÃüÁîºóÖ±½Ó¸úÒª"ignore"µÄ
´ÎÊý¾ÍÐС£
Èç¹ûÒ»¸ö¶ÏµãͬʱÓÐÒ»¸öignore countºÍÒ»¸öÌõ¼þʱ£¬Ìõ¼þ²»±»¼ì²é¡£Ö»Óе±
'ignore count'ΪÁãʱGDB²Å¿ªÊ¼¼ì²éÌõ¼þµÄÕæ¼Ù¡£
ÁíÍâÄã¿ÉÒÔÓÃ'condition'ÃüÁîÀ´»ñµÃÓëÓá®ignore count'ͬÑùЧ¹ûµÄ¶Ïµã¡£Ó÷¨
ÊÇÓÃÀàËÆÓÚ'$foo--<=0'µÄ²ÎÁ¿×÷Ϊ'condition'ÃüÁîµÄ²ÎÊý(ʹÓÃÒ»¸ö²»Í£¼õÁ¿µÄ±äÁ¿
×÷ΪÌõ¼þ±í´ïʽµÄ³ÉÔ±)¡£
--
--
¡ù À´Ô´:£®Yat-sen Channel argo.zsu.edu.cn£®[FROM: www.ee.zsu.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
Ò³ÃæÖ´ÐÐʱ¼ä£º2.063ºÁÃë