ʹÓÃGDBµ÷ÊÔǶÈëʽLinuxÉ豸
²½Ö裺
Ò»¡£ÊìϤÔÚÆÕͨµçÄÔÉÏÓÃ
GDBµ÷ÊԵĻù±¾·½Ê½¡£²Î¼û£º
http://www.ibm.com/developerworks/linux/library/l-gdb/
¶þ¡£ÏÂÔØ¡¶
gdb
quick reference¡·£¬
2ÕÅÖ½£¬´òÓ¡³öÀ´·ÅÔÚÊֱ߱¸Óá£
Èý¡£ÈÃǶÈëʽϵͳ֧³Ö
gdbserver.
£¨ÔÚ
openwrtÉÏ£¬¼´ÔÚ
make
menuconfigʱѡÔñ±àÒë
gdbserver£©
ËÄ¡£½øÐе÷ÊÔ
¶ÔÓÚµÚËÄ
µã£¬ÏÂÃæÒÔmips
cpu
ÉϵÄopenwrt
Ϊƽ̨½øÐоÙÀý
µçÄÔIPµØַΪ192.168.1.115, É豸IPµØַΪ192.168.1.1£¬»¥ÏàÄܽøÐÐIPͨÐÅ
ͨ¹ý½»²æ±àÒ빤¾ß£¬°ÑÈçÏ´úÂë±àÒë³ÉÉ豸ÉϵÄÖ§³ÖGDB
µÄ¿ÉÖ´ÐÐÎļþtest.bin
#include <stdio.h>
int main(int argc, char *argv[])
{
int i=0; i=1;
printf(“%d”, i++);
i++;
printf(“%d, %d”, j++, i++);
}
±àÒëÃüÁî¾ÙÀý£º
$(OPENWRT_DIR)/staging_dir/toolchain-mips_gcc4.1.2/bin/mips-linux-uclibc-gcc
-g -Wall -I. -I $(PWD)/../../Include/ -I
$(OPENWRT_DIR)/build_dir/linux-msp71xx/linux-2.6.20.21/ -o test.bin
test.c
½«±àÒë³öÀ´µÄtest.bin
¿½±´µ½Ç¶ÈëʽÉ豸ÉÏÅܵÄlinux
µÄ/usr/
Ŀ¼ÏÂ
ÔÚÉ豸ÉÏÖ´ÐÐÈçÏÂÓï¾äÆô¶¯GDBSERVER
gdbserver host:2345 /usr/test.bin
ÔÚµçÄÔÉÏÖ´ÐÐÈçÏÂÃüÁ
/openwrt/staging_dir/toolchain-mips_gcc4.1.2/bin/mips-linux-uclibc-gdb
test.bin
ÔÚµçÄÔÉϽøÈëGDB
µÄ½çÃæÁË£¬Ö´ÐÐÈçÏÂÃüÁî¸ømain
º¯Êý¼ÓÒ»¸ö¶Ïµã£º
break main
ÔÚµçÄÔÉϵÄGDB
½çÃæÖ´ÐÐÈçÏÂÃüÁ½¨Á¢ÓÚÉ豸ÉϵÄgdbserver
µÄÁ¬½Ó£º
target remote 192.168.1.1:2345
ÔÚµçÄÔÉϵÄGDB
½çÃæÖ´ÐÐÈçÏÂÃüÁʼÅܳÌÐò£º
continue
´Ëʱ±ã½øÈëµ÷ÊÔÁË£¬Ê¹ÓüûÇ°ÃæÌáµ½µÄ<gdb quick reference>
Ö´ÐÐÈçÏÂÃüÁîÖÕÖ¹GDB
µ÷ÊÔ£º
quit
Ïà¹ØÎĵµ£º
2009 Äê 4 ÔÂ 23 ÈÕ
±¾ÎÄÖÐÎÒÃÇÕë¶Ô Linux É϶àÏ̱߳à³ÌµÄÖ÷ÒªÌØÐÔ×ܽá³ö 5 Ìõ¾Ñ飬ÓÃÒÔ¸ÄÉÆ Linux ¶àÏ̱߳à³ÌµÄÏ°¹ßºÍ±ÜÃâÆäÖеĿª·¢ÏÝÚå¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃÇ´©²åһЩ Windows µÄ±à³ÌÓÃÀýÓÃÒÔ¶Ô±È Linux ÌØÐÔ£¬ÒÔ¼ÓÉî¶ÁÕßÓ¡Ïó¡£
±³¾°
Linux ƽ̨ÉϵĶàÏ̳߳ÌÐò¿ª·¢Ïà¶ÔÓ¦ÆäËûƽ̨£¨±ÈÈç Windows£©µÄ¶àÏß³Ì API ÓÐһЩϸ΢ ......
Linux ²Ù×÷ϵͳ´ÓÒ»¿ªÊ¼¾Í¶Ô´®ÐпÚÌṩÁ˺ܺõÄÖ§³Ö£¬±¾ÎÄ¾Í Linux ϵĴ®ÐпÚͨѶ±à³Ì½øÐмòµ¥µÄ½éÉÜ¡£ ´®¿Ú¼ò½é ´®ÐпÚÊǼÆËã»úÒ»ÖÖ³£ÓõĽӿڣ¬¾ßÓÐÁ¬½ÓÏßÉÙ£¬Í¨Ñ¶¼òµ¥£¬µÃµ½¹ã·ºµÄʹÓᣳ£ÓõĴ®¿ÚÊÇ RS-232-C ½Ó¿Ú£¨ÓÖ³Æ EIA RS-232-C£©ËüÊÇÔÚ 1970 ÄêÓÉ ......
ranfowµÄLinuxϳ£¼ûÎļþºó׺Ãû
.bz2 ------bzip2µÄѹËõÎļþ
.gz ------gzipµÄѹËõÎļþ
.tar ------tar´ò°üÎļþ£¨ÊÇ°üÎļþ²»ÊÇѹËõÎļþ£©
.tbz------tar´ò°ü²¢ÓÃbzipѹËõÎļþ
.tgz-----tar´ò°ü²¢ÓÃgzipѹËõµÄÎļþ
.au -----audioÎļþ
.gif -----gifͼÏóÎļþ
.html/.htm-----HTMLÎļþ
.jpg-----JPEGͼÏóÎļþ
.pdf ......
Ò».Linux¹ÒÔØUÅÌ:
1¡¢²åÈëuÅ̵½¼ÆËã»ú£¬Èç¹ûÄ¿Ç°Ö»²åÈëÁËÒ»¸öuÅ̶øÇÒÄãµÄÓ²Å̲»ÊÇscsiµÄÓ²Å̽ӿڵĻ°£¬ÄÇËüµÄÓ²¼þÃû³ÆΪ:sda1¡£
2¡¢ÔÚmntĿ¼ÏÂÏȽ¨Á¢Ò»¸öusbµÄĿ¼(Èç:[root@localhost root]# mkdir /mnt/usb)
3¡¢¹ÒÔØUÅÌ£ºmount -t vfat /dev/sda1 /mnt/usb
4¡¢Ð¶ÔØUÅÌ£ºumount /mnt ......
°²×°Tomcat6.0ºÍJDK1.6
ÔÚlinuxϵͳÉÏ°²×°tomcatºÍjdkÓ¦¸Ã˵ÊÇÎÒѧϰlinux֪ʶµÄµÚÒ»¿ÎÁË£¬Ö®Ç°Ö»
ÊÇÌý˵¹ý£¬´Óû½Ó´¥¹ý£¬µ«ÎÒÃǹ«Ë¾ÏîÄ¿¶¼ÊDz¿ÊðÔÚlinuxϵͳÉϵģ¬ÄÇÌìÉÏ˾ͻ
È»¸øÎÒ·¢Á˼¸¸öÎĵµ£¬ÈÃÎÒ¿´Ò»Ï£¬È»ºóÔÚÕýʽµÄ·þÎñÆ÷ÉÏ£¬°²×°jdkºÍtomcat£¬Ò»¿ªÊ¼Óеã¶ù»Å£¬ÏÈÔÚ±¾»ú×°Á˸öÐéÄâ»ú£¬·´¸´ÃþË÷²âÊÔÁ˼¸±é£¬Óöµ ......