arm-none-eabi-gdb

提供: FreeBSD入門
移動: 案内検索
スポンサーリンク

arm-none-eabi-gdb とは、ARMアーキテクチャ用のバイナリツールのGDBです。


読み方

arm-none-eabi-gdb
あーむ のん いー えーびーあい じーでぃーびー

概要

arm-none-eabi-gdb は、 ARM 用の GDB です。

arm-none-eabi-gdb-7.10_4
Name           : arm-none-eabi-gdb
Version        : 7.10_4
Installed on   : Sun Dec 13 14:34:20 2015 JST
Origin         : devel/arm-none-eabi-gdb
Architecture   : freebsd:10:x86:64
Prefix         : /usr/local
Categories     : devel
Licenses       :
Maintainer     : imp@FreeBSD.org
WWW            : http://www.gnu.org/software/gdb/
Comment        : GNU GDB for the arm bare metal target
Shared Libs required:
        libexpat.so.1
Annotations    :
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 4.77MiB
Description    :
This is the GNU Debugger GDB, configured for the AVR microcontroller
target.
 
This debugger cannot really be used standalone, but is useful in
connection with either AVaRICE (http://avarice.sourceforge.net/)
or simulavr (http://www.freesoftware.fsf.org/simulavr/).
 
WWW: http://www.gnu.org/software/gdb/

インストール

pkgコマンドでインストールする場合

sudo pkg install arm-none-eabi-gdb

ファイル

$ pkg info -l arm-none-eabi-gdb
arm-none-eabi-gdb-7.10_4:
        /usr/local/bin/arm-none-eabi-gdb

使い方

簡単に説明すると以下のコマンドで実行できます。

$ arm-none-eabi-gdb target.bin
(gdb) target sim
(gdb) load
(gdb) run

arm-none-eabi-gdb を利用して、FreeBSDの amd64 (AMD 64bit)な環境で ARM用の32ビットELFを動かすことができます。 以下の例は、 SECCON 2015 Oneline CTF の問題のバイナリの例です。

$ uname -a
FreeBSD a1.local 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul  8
06:37:44 UTC 2014
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
$ file 10.bin
10.bin: ELF 32-bit LSB executable, ARM, version 1, statically linked, stripped
$ arm-none-eabi-gdb 10.bin
GNU gdb (GDB) 7.10
Copyright (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=amd64-portbld-freebsd10.1 --target=arm-none-eabi".
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"...
Reading symbols from 10.bin...(no debugging symbols found)...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .text, size 0x848 vma 0x1400
Loading section .rodata, size 0xe4 vma 0x1c48
Loading section .data, size 0x4 vma 0x2000
Start address 0x1400
Transfer rate: 18816 bits in <1 sec.
(gdb) run
Starting program: /tmp/seccon201512/200_individual_elebin/Individual_Elebin/10.bin
8a0d28f[Inferior 1 (process 42000) exited normally]
(gdb) quit

関連項目




スポンサーリンク