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

首頁 > 學院 > 開發設計 > 正文

使用gdbserver+arm-linux-gdb 調試應用程序

2019-11-11 01:27:34
字體:
來源:轉載
供稿:網友

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

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

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

編譯 make

安裝 make install

至此,gdb安裝完成。

接下來為linux-arm安裝gdbserver

進入gdb-7.10.1/gdb/gdbserver

配置

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

make CC=arm-linux-gcc

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

chmod 777 gdbserver arm-linux-strip gdbserver

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

開始調試: 在板子的終端中運行 gdbserver –multi 10.0.14.38:1234 這里沒有指定待調試的應用程序文件名,這個文件名一會將會在pc端使用命令指定,然后pc端的arm-linux-gdb通過網絡把這寫信息發給gdbserver。 10.0.14.38這個地址是我的pc端的IP

在PC端運行

[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 指定在板子上需要運行的應用程序路徑。

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

接下來就行了。 設置斷點就可以開始調試了。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 梨树县| 襄垣县| 榕江县| 明光市| 南充市| 通许县| 乐平市| 民权县| 怀仁县| 平遥县| 日照市| 河北区| 兴山县| 木里| 迁安市| 霍山县| 乐业县| 汾阳市| 吉水县| 屯昌县| 西安市| 堆龙德庆县| 共和县| 泽库县| 韶关市| 驻马店市| 百色市| 外汇| 南江县| 梅河口市| 克什克腾旗| 通海县| 定远县| 读书| 和林格尔县| 华阴市| 筠连县| 洱源县| 和田市| 将乐县| 土默特左旗|