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

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

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

2019-11-11 02:03:30
字體:
供稿:網(wǎng)友

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

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

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

編譯 make

安裝 make install

至此,gdb安裝完成。

接下來為linux-arm安裝gdbserver

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

配置

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

make CC=arm-linux-gcc

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

chmod 777 gdbserver arm-linux-strip gdbserver

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

開始調(diào)試: 在板子的終端中運(yùn)行 gdbserver –multi 10.0.14.38:1234 這里沒有指定待調(diào)試的應(yīng)用程序文件名,這個文件名一會將會在pc端使用命令指定,然后pc端的arm-linux-gdb通過網(wǎng)絡(luò)把這寫信息發(fā)給gdbserver。 10.0.14.38這個地址是我的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.

說明: 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)用程序的路徑。

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


發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 寻乌县| 金沙县| 建平县| 辽源市| 玉门市| 东乡族自治县| 云安县| 新乡县| 云龙县| SHOW| 彭水| 平陆县| 朝阳市| 天津市| 河东区| 赣榆县| 大厂| 西吉县| 白朗县| 丰顺县| 江西省| 玉树县| 静安区| 南江县| 得荣县| 太谷县| 阿坝| 西和县| 崇州市| 清流县| 饶平县| 新民市| 漠河县| 澎湖县| 凭祥市| 西丰县| 金沙县| 剑河县| 黔南| 泾川县| 仪陇县|