How to compile GDB

 

 

您可以直接從網站上下載安裝,如果網路是好的話,請參考網站http://www.cygwin.com/,請注意安裝libiconv到你的cygwin中去。

如果你相信上面的那個公司自己的cygwin安裝包,請雙擊,一路到底。如果可能請注冊你的cygwin/bin到你的環境變量中。

 

首先請下載你的GDB從http://ftp.gnu.org/gnu/gdb/

這時你將得到gdb-6.8.tar.gz軟件包,下面是一個sample, 執行下列操作,你將完成GDB的編譯,獲得arm-linux-gdb.exe.

雙擊桌面上的cygwin快捷方式,登錄cygwin 模擬環境。

cd /cygdrive/g/gdb

tar zxvf gdb-6.8.tar.gz

mkdir gdb-build

cd gdb-build

../gdb-6.8/configure --target=arm-linux --enable-shared --prefix=/cygdrive/g/gdb/gdb-build --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettext

Make

Make install

OK, you will get arm-linux-gdb.exe, of course, it is not strip. If you strip it, please execute “strip arm-linux-gdb.exe”

 

2 Linux下compile GDB and GDB server

First, please setup your arm cross-compile toolschain。

 

2.1 Gdb-6.8 

首先請下載你的GDB從http://ftp.gnu.org/gnu/gdb/

這時你將得到gdb-6.8.tar.gz軟件包,下面是一個sample, 執行下列操作,你將完成GDB的編譯,獲得arm-linux-gdb  arm-linux-gdbserver.

 

cd /home/user/gdb-test/

tar zxvf gdb-6.8.tar.gz

mkdir gdb-build

cd gdb-build

../gdb-6.8/configure --target=arm-linux --prefix=/home/user/gdb-test/gdb-build

Make 

Make install

 

將生成下列的arm elf 文件:

arm-linux-gdb arm-linux-gdbtui  arm-linux-run  

如果你要strip 它的話,請用strip arm-linux-gdb。

 

mkdir gdbserver

cd gdbserver

CC=arm11_mtk_le-gcc ../../gdb-6.8/gdb/gdbserver/configure --target=arm-linux --host=arm-linux

Make

Make install

 

arm 格式gdbserver 將被生成。

如果你要strip 它的話,請用arm11_mtk_le-strip gdbserver。

 

3 Linux下compile ARM GDB

Please setup your arm cross-compile toolschain。

3.1 Gdb-6.8 

首先請下載你的GDB從http://ftp.gnu.org/gnu/gdb/

這時你將得到gdb-6.8.tar.gz軟件包,下面是一個sample, 執行下列操作,你將完成GDB的編譯,獲得arm-linux-gdb.exe.

 

cd /home/user/gdb-test/

tar zxvf gdb-6.8.tar.gz

mkdir arm-gdb-build

cd arm-gdb-build

CC=arm11_mtk_le-gcc AR=arm11_mtk_le-ar RANLIB=arm11_mtk_le-ranlib AS=arm11_mtk_le-as LD=arm11_mtk_le-ld ../gdb-6.8/configure --build=i686-pc-linux-gnu  --host=arm-linux --target=arm-linux  --prefix=/home/user/gdb-test/arm-gdb-build/ --enable-shared --without-x --disable-gdbtk --disable-tui --without-included-regex --without-included-gettextMake

Make install

 

Gdb 將被生成。

如果你要strip 它的話,請用arm11_mtk_le-strip arm-linux-gdb。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值