1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1999. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | @c $Id$ |
---|
7 | @c |
---|
8 | |
---|
9 | @chapter Building the GNU Debugger |
---|
10 | |
---|
11 | GDB is currently RTEMS aware only if you are using the remote debugging |
---|
12 | support via Ethernet. The following configurations have been |
---|
13 | successfully used with RTEMS applications: |
---|
14 | |
---|
15 | @itemize @bullet |
---|
16 | @item Sparc Instruction Simulator (SIS) |
---|
17 | @item PowerPC Instruction Simulator (PSIM) |
---|
18 | @item DINK32 |
---|
19 | @end itemize |
---|
20 | |
---|
21 | Other configurations of gdb have successfully been used by RTEMS users |
---|
22 | but are not documented here. |
---|
23 | |
---|
24 | It is recommended that when toolset binaries are available for |
---|
25 | your particular host, that they be used. Prebuilt binaries |
---|
26 | are much easier to install. |
---|
27 | |
---|
28 | @section Unarchive the gdb Distribution |
---|
29 | |
---|
30 | Use the following commands to unarchive the gdb distribution: |
---|
31 | |
---|
32 | @example |
---|
33 | cd tools |
---|
34 | tar xzf ../archive/@value{GDB-TAR} |
---|
35 | @end example |
---|
36 | |
---|
37 | The directory @value{GDB-UNTAR} is created under the tools directory. |
---|
38 | |
---|
39 | @c |
---|
40 | @c GDB Patch |
---|
41 | @c |
---|
42 | |
---|
43 | @section Apply RTEMS Patch to GDB |
---|
44 | |
---|
45 | @ifclear GDB-RTEMSPATCH |
---|
46 | No RTEMS specific patches are required for @value{GDB-VERSION} to |
---|
47 | support @value{RTEMS-VERSION}. |
---|
48 | @end ifclear |
---|
49 | |
---|
50 | @ifset GDB-RTEMSPATCH |
---|
51 | |
---|
52 | Apply the patch using the following command sequence: |
---|
53 | |
---|
54 | @example |
---|
55 | cd tools/@value{GDB-UNTAR} |
---|
56 | zcat archive/@value{GDB-RTEMSPATCH} | patch -p1 |
---|
57 | @end example |
---|
58 | |
---|
59 | Check to see if any of these patches have been rejected using the following |
---|
60 | sequence: |
---|
61 | |
---|
62 | @example |
---|
63 | cd tools/@value{GDB-UNTAR} |
---|
64 | find . -name "*.rej" -print |
---|
65 | @end example |
---|
66 | |
---|
67 | If any files are found with the .rej extension, a patch has been rejected. |
---|
68 | This should not happen with a good patch file. |
---|
69 | |
---|
70 | @end ifset |
---|
71 | |
---|
72 | @section Using the bit_gdb script |
---|
73 | |
---|
74 | The simplest way to build gdb for RTEMS is to use the @code{bit_gdb} script. |
---|
75 | This script interprets the settings in the @code{user.cfg} file to |
---|
76 | produce the gdb configuration most appropriate for the target CPU. |
---|
77 | |
---|
78 | This script is invoked as follows: |
---|
79 | |
---|
80 | @example |
---|
81 | ./bit_gdb CPU |
---|
82 | @end example |
---|
83 | |
---|
84 | Where CPU is one of the RTEMS supported CPU families from the following |
---|
85 | list: |
---|
86 | |
---|
87 | @itemize @bullet |
---|
88 | @item hppa1.1 |
---|
89 | @item i386 |
---|
90 | @item i386-elf |
---|
91 | @item i386-go32 |
---|
92 | @item i960 |
---|
93 | @item m68k |
---|
94 | @item mips64orion |
---|
95 | @item powerpc |
---|
96 | @item sh |
---|
97 | @item sparc |
---|
98 | @end itemize |
---|
99 | |
---|
100 | If gdb supports a CPU instruction simulator for this configuration, then |
---|
101 | it is included in the build. |
---|
102 | |
---|
103 | @section Using the gdb configure Script Directly |
---|
104 | |
---|
105 | @subsection GDB with Sparc Instruction Simulation (SIS) |
---|
106 | |
---|
107 | @subheading Make the Build Directory |
---|
108 | |
---|
109 | Create a build directory for the SIS Debugger |
---|
110 | |
---|
111 | @example |
---|
112 | cd tools |
---|
113 | mkdir build-sis |
---|
114 | @end example |
---|
115 | |
---|
116 | @subheading Configure for the Build |
---|
117 | |
---|
118 | Configure the GNU Debugger for the |
---|
119 | Sparc Instruction Simulator (SIS): |
---|
120 | |
---|
121 | @example |
---|
122 | cd tools/build-sis |
---|
123 | ../@value{GDB-UNTAR}/configure --target-sparc-erc32-aout \ |
---|
124 | --program-prefix=sparc-rtems- \ |
---|
125 | --disable-gdbtk \ |
---|
126 | --enable-targets=all \ |
---|
127 | --prefix=<INSTALL_POINT_FOR_SIS> |
---|
128 | @end example |
---|
129 | |
---|
130 | Where <INSTALL_POINT_FOR_SIS> is a unique location where the gdb |
---|
131 | with SIS will be created. |
---|
132 | |
---|
133 | @subheading Make the Debugger |
---|
134 | |
---|
135 | From tools/build-sis execute the following command sequence: |
---|
136 | |
---|
137 | @example |
---|
138 | gmake all install |
---|
139 | @end example |
---|
140 | |
---|
141 | |
---|
142 | @subsection GDB with PowerPC Instruction Simulator |
---|
143 | |
---|
144 | @subheading Make the Build Directory |
---|
145 | |
---|
146 | Create a build directory for the SIS Debugger |
---|
147 | |
---|
148 | @example |
---|
149 | cd tools |
---|
150 | mkdir build-ppc |
---|
151 | @end example |
---|
152 | |
---|
153 | @subheading Configure for the Build |
---|
154 | |
---|
155 | Configure the GNU Debugger for the PowerPC |
---|
156 | Instruction Simulator (PSIM): |
---|
157 | |
---|
158 | @example |
---|
159 | cd tools/build-ppc |
---|
160 | ../@value{GDB-UNTAR}/configure \ |
---|
161 | --target=powerpc-unknown-eabi \ |
---|
162 | --program-prefix=powerpc-rtems- \ |
---|
163 | --enable-sim-powerpc \ |
---|
164 | --enable-sim-timebase \ |
---|
165 | --enable-sim-inline \ |
---|
166 | --enable-sim-hardware \ |
---|
167 | --enable-targets=all \ |
---|
168 | --prefix=<INSTALL_POINT_FOR_PPC> |
---|
169 | @end example |
---|
170 | |
---|
171 | Where <INSTALL_POINT_FOR_PPC> is a unique location where the gdb |
---|
172 | with PSIM will be created. |
---|
173 | |
---|
174 | |
---|
175 | @subheading Make the Debugger |
---|
176 | |
---|
177 | From tools/build-ppc execute the following command sequence: |
---|
178 | |
---|
179 | @example |
---|
180 | gmake all install |
---|
181 | @end example |
---|
182 | |
---|
183 | |
---|
184 | @subsection GDB for DINK32 |
---|
185 | |
---|
186 | @subheading Make the Build Directory |
---|
187 | |
---|
188 | Create a build directory for the DINK32 Debugger |
---|
189 | |
---|
190 | @example |
---|
191 | cd tools |
---|
192 | mkdir build-dink32 |
---|
193 | @end example |
---|
194 | |
---|
195 | @subheading Configure for the Build |
---|
196 | |
---|
197 | Configure the GNU Debugger to communicate with |
---|
198 | the DINK32 ROM monitor: |
---|
199 | |
---|
200 | @example |
---|
201 | cd tools/build-dink32 |
---|
202 | ../@value{GDB-UNTAR}/configure --target-powerpc-elf \ |
---|
203 | --program-prefix=powerpc-rtems- \ |
---|
204 | --enable-targets=all \ |
---|
205 | --prefix=<INSTALL_POINT_FOR_DINK32> |
---|
206 | @end example |
---|
207 | |
---|
208 | Where <INSTALL_POINT_FOR_DINK32> is a unique location where the |
---|
209 | gdb Dink32 will be created. |
---|
210 | |
---|
211 | @subheading Make the Debugger |
---|
212 | |
---|
213 | From tools/build-dink32 execute the following command sequence: |
---|
214 | |
---|
215 | @example |
---|
216 | gmake all install |
---|
217 | @end example |
---|
218 | |
---|