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