I recently had to build a gdb that worked on our development host, but understood arm binaries and core files. It turns out to be fairly easy to do this in the FreeBSD tree. I did this on RELENG_6, but the same techniques will work for RELENG_7 or -CURRENT.
The Cookbook
- % setenv TARGET_ARCH arm
- % cd /usr/src/gnu/usr.bin/binutils
- % make depend all
- % cd ../gdb
- % make depend all
- % cd gdb
- # make install
Running the debugger
You can run the debugger just like you would other binaries.
- gdb-arm binary binary.core
That's it! Pretty simple, all in all, to create the cross debugger.
The cross-gdb port
As has been pointed out in feedback, one can also use the devel/gdb-cross port to make this even easier. I've not used this method. Maybe I'll investigate and report in another posting.
Alternatively, you can possibly try to use devel/cross-gdb port for this.
ReplyDelete