161
|
1 |
|
|
2 |
Welcome file
|
|
3 |
|
|
4 |
|
|
5 |
# Building GDB for use with *libgdbs*
|
|
6 |
|
|
7 |
As of today, *libgdbs* require a very recent version of GDB. This is because
|
|
8 |
*libgdbs* requires various patches. Some of them are are already upstreamed
|
|
9 |
to [GDB's master branch][1], some of them are in process.
|
|
10 |
|
|
11 |
Therefore you may need to compile suitable GDB yourself. A git repository with
|
|
12 |
all the patches can be found at [https://bitbucket.org/janvrany/binutils-gdb][2]
|
|
13 |
*in branch `users/jv/vdb`* (note the branch!)
|
|
14 |
|
|
15 |
## Linux
|
|
16 |
|
|
17 |
Following recipe has been tested on Debian Buster as of 2018-11-26.
|
|
18 |
|
|
19 |
### Preparing build environment
|
|
20 |
|
|
21 |
apt-get install build-essentials texinfo python3-dev flex bison libfl libexpat-dev
|
|
22 |
|
|
23 |
### Preparing build environment
|
|
24 |
|
|
25 |
git clone https://bitbucket.org/janvrany/binutils-gdb.git
|
|
26 |
cd binutils-gdb
|
|
27 |
./configure \
|
|
28 |
--disable-werror \
|
|
29 |
--with-guile=no \
|
|
30 |
--with-python=/usr/bin/python3 \
|
|
31 |
--enable-targets="i686-pc-linux-gnu,x86_64-pc-linux-gnu,i686-w64-mingw32,x86_64-w64-mingw32,riscv64-pc-linux-gnu,ppc-pc-linux-gnu"
|
|
32 |
make -j4
|
|
33 |
|
|
34 |
|
|
35 |
You may want to tweak target list to fot your needs, the above list includes
|
|
36 |
both i686 and x86_64 Linux, both i686 and x86_64 Windows,PowerPC and RISC-V 64
|
|
37 |
Linux.
|
|
38 |
|
|
39 |
## Windows using MSYS2 and MINGW64
|
|
40 |
|
|
41 |
Following recipe has been tested on Windows 7 anc Windows 10 using [MSYS2][3]
|
|
42 |
and `MinGW 64`.
|
|
43 |
|
|
44 |
### Preparing build environment
|
|
45 |
|
|
46 |
In order to build GDB from source, you need to install [MSYS2][3] and `MinGW 64`
|
|
47 |
toolchain:
|
|
48 |
|
|
49 |
* Install [MSYS2][3] from [https://msys2.github.io][3]. Make sure to install
|
|
50 |
it to `C:\MSYS64`. Once installer finishes, update packages:
|
|
51 |
|
|
52 |
C:\msys64\usr\bin\pacman.exe -Sy pacman
|
|
53 |
C:\msys64\usr\bin\pacman.exe -Syu
|
|
54 |
C:\msys64\usr\bin\pacman.exe -Su
|
|
55 |
|
|
56 |
Note: during `pacman -Syu` you maybe asked to close command prompt window.
|
|
57 |
Don't forget to close it otherwise you will have to start from beginning.
|
|
58 |
|
|
59 |
* Add `C:\msys64\usr\bin` to your `PATH`:
|
|
60 |
|
|
61 |
setx PATH "%PATH%;c:\msys64\usr\bin"
|
|
62 |
|
|
63 |
* Install `MinGW 64` toolchain and other dev tools:
|
|
64 |
|
|
65 |
pacman -S git bison flex texinfo mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL mingw-w64-x86_64-libexpat mingw-w64-x86_64-python3
|
|
66 |
|
|
67 |
### Compiling GDB
|
|
68 |
|
|
69 |
git clone https://bitbucket.org/janvrany/binutils-gdb.git
|
|
70 |
cd binutils-gdb
|
|
71 |
set "PATH=%PATH%;C:\msys64\mingw64\bin"
|
|
72 |
bash configure --build=x86_64-w64-mingw32 --disable-werror --with-guile=no --with-python=C:\msys64\mingw64\bin\python3 --enable-targets="i686-w64-mingw32,x86_64-w64-mingw32"
|
|
73 |
make -j4
|
|
74 |
|
|
75 |
[1]: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=summary
|
|
76 |
[2]: https://bitbucket.org/janvrany/binutils-gdb
|
|
77 |
[3]: https://msys2.github.io/
|
|
78 |
|