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=
"VxWorks%20Download">VxWorks Download
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"VxWorks-Attach.html#VxWorks%20Attach">VxWorks Attach
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"VxWorks-Connection.html#VxWorks%20Connection">VxWorks Connection
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"VxWorks.html#VxWorks">VxWorks
</a>
19 <h5 class=
"subsubsection">VxWorks download
</h5>
21 <p>If you have connected to the VxWorks target and you want to debug an
22 object that has not yet been loaded, you can use the GDB
23 <code>load
</code> command to download a file from Unix to VxWorks
24 incrementally. The object file given as an argument to the
<code>load
</code>
25 command is actually opened twice: first by the VxWorks target in order
26 to download the code, then by GDB in order to read the symbol
27 table. This can lead to problems if the current working directories on
28 the two systems differ. If both systems have NFS mounted the same
29 filesystems, you can avoid these problems by using absolute paths.
30 Otherwise, it is simplest to set the working directory on both systems
31 to the directory in which the object file resides, and then to reference
32 the file by its name, without any path. For instance, a program
33 <code>prog.o
</code> may reside in
<code></code><var>vxpath
</var><code>/vw/demo/rdb
</code> in VxWorks
34 and in
<code></code><var>hostpath
</var><code>/vw/demo/rdb
</code> on the host. To load this
35 program, type this on VxWorks:
37 <pre class=
"example"> -
> cd
"<var>vxpath</var>/vw/demo/rdb"
40 <p>Then, in GDB, type:
42 <pre class=
"example"> (vxgdb) cd
<var>hostpath
</var>/vw/demo/rdb
46 GDB displays a response similar to this:
48 <pre class=
"smallexample"> Reading symbol data from wherever/vw/demo/rdb/prog.o... done.
51 <p>You can also use the
<code>load
</code> command to reload an object module
52 after editing and recompiling the corresponding source file. Note that
53 this makes GDB delete all currently-defined breakpoints,
54 auto-displays, and convenience variables, and to clear the value
55 history. (This is necessary in order to preserve the integrity of
56 debugger's data structures that reference the target system's symbol