3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Sparclet">Sparclet
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Sparclite.html#Sparclite">Sparclite
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"SH.html#SH">SH
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Embedded-Processors.html#Embedded%20Processors">Embedded Processors
</a>
19 <h4 class=
"subsection">Tsqware Sparclet
</h4>
21 GDB enables developers to debug tasks running on
22 Sparclet targets from a Unix host.
23 GDB uses code that runs on
24 both the Unix host and on the Sparclet target. The program
25 <code>gdb
</code> is installed and executed on the Unix host.
28 <dt><code>remotetimeout
</code><var>args
</var><code></code>
29 <dd>GDB supports the option
<code>remotetimeout
</code>.
30 This option is set by the user, and
<var>args
</var> represents the number of
31 seconds GDB waits for responses.
34 <p>When compiling for debugging, include the options
<code>-g
</code> to get debug
35 information and
<code>-Ttext
</code> to relocate the program to where you wish to
36 load it on the target. You may also want to add the options
<code>-n
</code> or
37 <code>-N
</code> in order to reduce the size of the sections. Example:
39 <pre class=
"example"> sparclet-aout-gcc prog.c -Ttext
0x12010000 -g -o prog -N
42 <p>You can use
<code>objdump
</code> to verify that the addresses are what you intended:
44 <pre class=
"example"> sparclet-aout-objdump --headers --syms prog
48 your Unix execution search path to find GDB, you are ready to
49 run GDB. From your Unix host, run
<code>gdb
</code>
50 (or
<code>sparclet-aout-gdb
</code>, depending on your installation).
52 GDB comes up showing the prompt:
54 <pre class=
"example"> (gdbslet)
58 <li><a accesskey=
"1" href=
"Sparclet-File.html#Sparclet%20File">Sparclet File
</a>: Setting the file to debug
59 <li><a accesskey=
"2" href=
"Sparclet-Connection.html#Sparclet%20Connection">Sparclet Connection
</a>: Connecting to Sparclet
60 <li><a accesskey=
"3" href=
"Sparclet-Download.html#Sparclet%20Download">Sparclet Download
</a>: Sparclet download
61 <li><a accesskey=
"4" href=
"Sparclet-Execution.html#Sparclet%20Execution">Sparclet Execution
</a>: Running and debugging