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%20Download">Sparclet Download
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Sparclet-Execution.html#Sparclet%20Execution">Sparclet Execution
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Sparclet-Connection.html#Sparclet%20Connection">Sparclet Connection
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Sparclet.html#Sparclet">Sparclet
</a>
19 <h5 class=
"subsubsection">Sparclet download
</h5>
21 <p>Once connected to the Sparclet target,
23 <code>load
</code> command to download the file from the host to the target.
24 The file name and load offset should be given as arguments to the
<code>load
</code>
26 Since the file format is aout, the program must be loaded to the starting
27 address. You can use
<code>objdump
</code> to find out what this value is. The load
28 offset is an offset which is added to the VMA (virtual memory address)
29 of each of the file's sections.
30 For instance, if the program
31 <code>prog
</code> was linked to text address
0x1201000, with data at
0x12010160
32 and bss at
0x12010170, in GDB, type:
34 <pre class=
"example"> (gdbslet) load prog
0x12010000
35 Loading section .text, size
0xdb0 vma
0x12010000
38 <p>If the code is loaded at a different address then what the program was linked
39 to, you may need to use the
<code>section
</code> and
<code>add-symbol-file
</code> commands
40 to tell GDB where to map the symbol table.