尊龙凯时人生就是搏

LinuxÏÂʹÓÃGDBµ÷ÊÔǶÈëʽARM³ÌÐòµÄ³£¼ûÉèÖÃÒªÁì

linuxÏÂʹÓÃgdbµ÷ÊÔǶÈëʽarm³ÌÐòµÄ³£¼ûÉèÖÃÒªÁì

ǶÈëʽϵͳ×÷ΪһÖÖÌØÊâµÄÅÌËã»úϵͳ £¬Í¨³£¼¯³ÉÔÚµç×Ó×°±¸ÖÐ £¬ÓÃÓÚ¿ØÖƺÍÖÎÀíÓ²¼þ×ÊÔ´¡£ÎªÁ˵÷ÊÔºÍÆÊÎöǶÈëʽϵͳµÄÔËÐÐ״̬ £¬ÎÒÃÇÐèҪʹÓÃרÃŵŤ¾ß¡£ÆäÖÐ £¬GDBÊÇÒ»ÖÖ³£ÓõĿªÔ´µ÷ÊÔÆ÷ £¬ËüÄܹ»ÔÚǶÈëʽϵͳÉÏÔËÐв¢Óë³ÌÐò¾ÙÐÐͨѶ¡£±¾ÎĽ«ÏÈÈÝÔÚlinuxÏÂʹÓÃgdbµ÷ÊÔǶÈëʽarm³ÌÐòµÄ³£¼ûÉèÖÃÒªÁì £¬²¢¸ø³ö´úÂëʾÀý¡£

×°ÖÃÐëÒªµÄÈí¼þºÍ¹¤¾ß

ÔÚ×îÏÈ֮ǰ £¬ÎÒÃÇÐèҪװÖÃһЩÐëÒªµÄÈí¼þºÍ¹¤¾ß¡£Ê×ÏÈ £¬È·±£LinuxϵͳÖÐÒѾ­×°ÖÃÁËGCC¹¤¾ßÁ´ £¬ÓÃÓÚ±àÒëARM³ÌÐò¡£½ÓÏÂÀ´ £¬Ê¹ÓÃÒÔÏÂÏÂÁî×°ÖÃGDBµ÷ÊÔÆ÷£º

sudo apt-get install gdb-multiarch

µÇ¼ºó¸´ÖÆ

±àÒëǶÈëʽARM³ÌÐò

ÔÚ¾ÙÐе÷ÊÔ֮ǰ £¬ÎÒÃÇÐèÒªÏȱàÒëÒ»¸ö¼òÆÓµÄǶÈëʽARM³ÌÐò¡£ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄʾÀý³ÌÐò £¬ÓÃÓÚÅÌËãÁ½¸öÊýµÄºÍ£º

#include <stdio.h>

int main() {
    int a = 5;
    int b = 10;
    int sum = a + b;
    printf("Sum: %d
", sum);
    return 0;
}

µÇ¼ºó¸´ÖÆ

ÉúÑÄÒÔÉÏ´úÂëΪsum.cÎļþ¡£

ʹÓÃÒÔÏÂÏÂÁî±àÒë¸Ã³ÌÐò£º

arm-linux-gnueabi-gcc -o sum sum.c

µÇ¼ºó¸´ÖÆ

±àÒëÍê³Éºó £¬½«ÔÚÄ¿½ñĿ¼ÏÂÌìÉúÒ»¸öÃûΪsumµÄ¿ÉÖ´ÐÐÎļþ¡£

ÅþÁ¬Ç¶ÈëʽARM×°±¸

½«Ç¶ÈëʽARM×°±¸ÅþÁ¬µ½LinuxÖ÷»ú¡£Ê¹ÓÃUSBÏßÀÂÅþÁ¬Á½Õß £¬²¢È·±£×°±¸´¦ÓÚµ÷ÊÔģʽÏ¡£

Æô¶¯GDBµ÷ÊÔÆ÷

ÔÚLinuxÖ÷»úÉÏÆô¶¯GDBµ÷ÊÔÆ÷ £¬²¢Ê¹ÓÃÒÔÏÂÏÂÁî·­¿ª¿ÉÖ´ÐÐÎļþ£º

gdb-multiarch sum

µÇ¼ºó¸´ÖÆ

´Ëʱ £¬GDB»áÏÔʾһ¸öÏÂÁîÐнçÃæ £¬ÆÚ´ýÊäÈëµ÷ÊÔÖ¸Áî¡£

ÉèÖÃGDBÅþÁ¬

ÔÚGDBÏÂÁîÐнçÃæÖÐ £¬ÊäÈëÒÔÏÂÏÂÁîÉèÖÃGDBÅþÁ¬µ½Ç¶ÈëʽARM×°±¸£º

target remote :8888

µÇ¼ºó¸´ÖÆ

ÕâÀïµÄ8888ÊÇÉè±¹ØÁ¬ÄGDBЧÀÍÆ÷¼àÌý¶Ë¿ÚºÅ¡£Çë×¢ÖØ £¬ÏêϸµÄ¶Ë¿ÚºÅ¿ÉÄÜÒò×°±¸¶øÒì £¬ÐèҪƾ֤ÏÖÕæÏàÐξÙÐе÷½â¡£

ÉèÖöϵã

ÔÚGDBÏÂÁîÐнçÃæÖÐ £¬ÊäÈëÒÔÏÂÏÂÁîÉèÖöϵ㣺

break main

µÇ¼ºó¸´ÖÆ

Õ⽫ÔÚ³ÌÐòµÄmainº¯ÊýÖÐÉèÖÃÒ»¸ö¶Ïµã £¬ÒÔ±ãÔÚ³ÌÐòÖ´Ðе½¸Ãº¯ÊýʱÔÝÍ£¡£

×îÏȵ÷ÊÔ

ÊäÈëÒÔÏÂÏÂÁî×îÏȵ÷ÊÔ£º

continue

µÇ¼ºó¸´ÖÆ

Õ⽫ʹ³ÌÐò×îÏÈÖ´ÐÐ £¬²¢ÔÚÓöµ½¶Ïµãʱ×èÖ¹¡£

µ÷ÊÔÀú³Ì

ÔÚ³ÌÐò×èÖ¹Ö´ÐÐʱ £¬ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏÂÏÂÁî¾ÙÐе÷ÊÔ£º

next£ºÖ´ÐÐÏÂÒ»ÐдúÂë

step£º½øÈ뺯ÊýÄÚ²¿

list£ºÏÔʾԴ´úÂë

print£º´òÓ¡±äÁ¿Öµ

watch£º¼àÊÓ±äÁ¿Öµ×ª±ä

continue£º¼ÌÐø³ÌÐòÖ´ÐÐ

quit£ÎÂ˳öGDBµ÷ÊÔÆ÷

ÒÔ´ËÀàÍÆ¡£

¿¢Êµ÷ÊÔ

µ±µ÷ÊÔÍê³Éʱ £¬¿ÉÒÔÊäÈëÒÔÏÂÏÂÁîÍ˳öGDBµ÷ÊÔÆ÷£º

quit

µÇ¼ºó¸´ÖÆ

±¾ÎÄÏÈÈÝÁËÔÚlinuxÏÂʹÓÃgdbµ÷ÊÔǶÈëʽarm³ÌÐòµÄ³£¼ûÉèÖÃÒªÁì £¬²¢ÌṩÁ˼òÆӵĴúÂëʾÀý¡£Ï£Íûͨ¹ý±¾ÎĵÄÏÈÈÝ £¬¶ÁÕßÄܹ»ÏàʶÔõÑùʹÓÃGDBÔÚLinuxÇéÐÎϵ÷ÊÔǶÈëʽARM³ÌÐò £¬ÒÔ¸üºÃµØÆÊÎöºÍµ÷ÊÔǶÈëʽϵͳµÄÔËÐÐ״̬¡£

ÒÔÉϾÍÊÇLinuxÏÂʹÓÃGDBµ÷ÊÔǶÈëʽARM³ÌÐòµÄ³£¼ûÉèÖÃÒªÁìµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ