国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

使用gdbserver+arm-linux-gdb 調(diào)試應(yīng)用程序

2019-11-11 02:04:25
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

1.下載gdb的源碼 2.編譯:

cd gdb-7.10.1./configure --target=arm-linux --PRefix=$PWD/installed -v

解釋一下: –target配置gdb的目標(biāo)平臺(tái); –prefix配置安裝路徑,我在gdb-7.10.1的目錄下創(chuàng)建了installed這個(gè)目錄,用來(lái)存放編譯后生成的文件。 下面就是開(kāi)始編譯了。

編譯 make

安裝 make install

至此,gdb安裝完成。

接下來(lái)為linux-arm安裝gdbserver

進(jìn)入gdb-7.10.1/gdb/gdbserver

配置

./configure --target=arm-linux --host=arm-linux

make CC=arm-linux-gcc

沒(méi)有錯(cuò)誤的話就在當(dāng)前路徑下生成gdbserver. 下面是做一下權(quán)限的修改和去掉無(wú)關(guān)的調(diào)試信息,這些東西用不到,去掉后還能減少文件大小。

chmod 777 gdbserver arm-linux-strip gdbserver

此時(shí)需要注意的是 1.gdbserver這個(gè)文件需要通過(guò)nfs弄到板子上去,且在板子上運(yùn)行; 2.與gdbserver配套的需要使用剛才編譯gdb時(shí)生成的arm-linux-gdb,它在pc上運(yùn)行

開(kāi)始調(diào)試: 在板子的終端中運(yùn)行 gdbserver –multi 10.0.14.38:1234 這里沒(méi)有指定待調(diào)試的應(yīng)用程序文件名,這個(gè)文件名一會(huì)將會(huì)在pc端使用命令指定,然后pc端的arm-linux-gdb通過(guò)網(wǎng)絡(luò)把這寫(xiě)信息發(fā)給gdbserver。 10.0.14.38這個(gè)地址是我的pc端的IP

在PC端運(yùn)行

[zhang@zwfedora23 tmp]$ ./arm-linux-gdb GNU gdb (GDB) 7.10.1Copyright (C) 2015 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. Type "show copying"and "show warranty" for details.This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-linux".Type "show configuration" for configuration details.For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.For help, type "help".Type "apropos Word" to search for commands related to "word".(gdb) target extended-remote 10.0.14.221:1234Remote debugging using 10.0.14.221:1234(gdb) set remote exec-file /mnt/nfs/sample_audio(gdb) file ~/work/60G/my_tools/hi3518-mpp/bak/ mpp/ mpp-2017-02-06-static-ok.tar.bz2 convertfile.sh mpp-2017-01-24-dynamic-ok.tar.bz2 mpp.tgz (gdb) file ~/work/60G/my_tools/hi3518-mpp/bak/ mpp/ mpp-2017-02-06-static-ok.tar.bz2 convertfile.sh mpp-2017-01-24-dynamic-ok.tar.bz2 mpp.tgz (gdb) file ~/work/60G/my_tools/hi3518-mpp/mpp/Makefile.param component/ cscope.out extdrv/ include/ ko/ lib/ sample/ tags tools/ types_c.taghl(gdb) file ~/work/60G/my_tools/hi3518-mpp/mpp/sample/audio/sample_audioReading symbols from ~/work/60G/my_tools/hi3518-mpp/mpp/sample/audio/sample_audio...done.(gdb) b mainBreakpoint 1 at 0xa61c: file sample_audio.c, line 457.(gdb) rStarting program: /home/zhang/work/60G/my_tools/hi3518-mpp/mpp/sample/audio/sample_audio Reading /lib/ld-linux.so.3 from remote target...warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.Reading /lib/ld-linux.so.3 from remote target...Reading /lib/libpthread.so.0 from remote target...Reading /lib/libm.so.6 from remote target...Reading /system/lib/libasound.so.2 from remote target...Reading /usr/lib/librb.so from remote target...Reading /lib/libc.so.6 from remote target...Reading /lib/libdl.so.2 from remote target...Reading /system/lib/librt.so.1 from remote target...Reading /system/lib/libgcc_s.so.1 from remote target...Breakpoint 1, main (argc=1, argv=0xbefffe54) at sample_audio.c:457457 HI_S32 s32Ret= HI_SUCCESS;(gdb) cContinuing.

說(shuō)明: 1.target extended_remote 10.0.14.221:1234 這里的ip是板子的ip。

2.(gdb) set remote exec-file /mnt/nfs/sample_audio 指定在板子上需要運(yùn)行的應(yīng)用程序路徑。

3.file ~/work/60G/my_tools/hi3518-mpp/mpp/sample/audio/sample_audio 指定在PC上需要調(diào)試的應(yīng)用程序的路徑。

接下來(lái)就行了。 設(shè)置斷點(diǎn)就可以開(kāi)始調(diào)試了。


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 彩票| 宁南县| 景东| 赣榆县| 来宾市| 郓城县| 红河县| 那坡县| 屏山县| 台中县| 云霄县| 乳源| 济宁市| 千阳县| 湘西| 崇左市| 阿拉善左旗| 吐鲁番市| 宜君县| 大丰市| 宁明县| 浪卡子县| 称多县| 武宁县| 大足县| 盐山县| 汤阴县| 祥云县| 正蓝旗| 黄冈市| 台北县| 洛宁县| 罗源县| 舒兰市| 剑阁县| 金门县| 大余县| 金堂县| 阳信县| 平顶山市| 扬州市|