User Tools

Site Tools


gdb_install

GDB 6.8 Installation

Gdb included in the new OpenRISC toolchain has even more issues than the old one 6.8.

Gdb 6.8 was working fine, specially with the hardware patch for or1200_v1 from Nathan.

But not many people know/knew how to compile or32-elf-gdb and the old script, used for this purpose, is not linked on the toolchain website anymore. The gdb-6.8 binary on the same website is not patched, thus you get the register is no longer active report everytime you try to set the pc.

What to do? I reconstructed the gdb compilation retrieving the source and patch addresses from the old toolchain installation script which I found on Internet. I extracted the necessary information and made a pretty small script consisting of only necessary commands to install it.

The script will try to install to /opt/gdb_stable, so you have to have permissions to write to /opt directory, otherwise run the script as superuser.

You can change the target directory by modifying line 16 /opt/gdb_stable to something else.

The script will download/uncompress/patch/compile everything to gdb_stable from the directory where you run it. You can delete the directory after running it.

After finishing the installation, add the target directory (/opt/gdb_stable/bin) to the PATH variable on ~/.bashrc (the .bashrc file on your home directory). Be sure to include this directory before the regular toolchain directory. This way, or32-elf-gdb version 6.8 will be called instead of 7.2. (Example: PATH=$PATH:/opt/Xilinx/10.1/ISE/bin/lin:/opt/gdb_stable/bin:/opt/openrisc/bin:/opt/or1ksim/bin)

I hope that help you guys.

GDB Installation Script

build_gdb.sh
#!/bin/sh
mkdir gdb_stable
cd gdb_stable
wget ftp://anonymous:anonymous@ftp.gnu.org/gnu/gdb/gdb-6.8.tar.bz2
wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-gdb-6.8-patch-2.4.bz2
svn export http://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk/Patches/GDB6.8/gdb-6.8-bz436037-reg-no-longer-active.patch
 
tar -jxvf gdb-6.8.tar.bz2
bzip2 -d or32-gdb-6.8-patch-2.4.bz2
cd gdb-6.8
patch -p1 < ../or32-gdb-6.8-patch-2.4
patch -p1 < ../gdb-6.8-bz436037-reg-no-longer-active.patch
mkdir b-gdb
mkdir installation
cd b-gdb
../configure --target=or32-elf --disable-werror --prefix=/opt/gdb_stable
make
make install
gdb_install.txt · Last modified: 2011/08/26 12:52 by Raul Fajardo