1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >Using the command line</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos User Guide"
20 HREF="ecos-user-guide.html"><LINK
22 TITLE="Running an eCos Test Case"
23 HREF="running-an-ecos-test-case.html"><LINK
25 TITLE="Running an eCos Test Case"
26 HREF="running-an-ecos-test-case.html"><LINK
28 TITLE="Testing Filters"
29 HREF="testing-filters.html"></HEAD
40 SUMMARY="Header navigation table"
57 HREF="running-an-ecos-test-case.html"
65 >Chapter 12. Running an <SPAN
74 HREF="testing-filters.html"
88 NAME="USING-COMMANDLINE-TESTCASE">Using the command line</H1
90 >Start a command shell (such as a Cygwin shell window in Windows)
91 with the environment variables set as described in the toolchain
92 documentation. Change to the directory in which you set up your build
93 tree, and invoke GDB on the test
96 >To run the bin_sem0 test (which will
97 test the kernel for the correct creation and destruction of binary
106 CLASS="PROGRAMLISTING"
112 >gdb -nw install/tests/kernel/<TT
115 ><version></I
117 >/tests/bin_sem0</PRE
122 >You should see output similar to the following in the command
131 CLASS="PROGRAMLISTING"
132 >GNU gdb THIS-GDB-VERSION
133 Copyright 2001 Free Software Foundation, Inc.
134 GDB is free software, covered by the GNU General Public License, and you are
135 welcome to change it and/or distribute copies of it under certain conditions.
136 Type "show copying" to see the conditions.
137 There is absolutely no warranty for GDB. Type "show warranty" for details.
138 This GDB was configured as "--host=THIS-HOST --target=THIS-TARGET".
144 >If you are trying to run a synthetic target test on Linux, skip the following connection and download
145 steps. Otherwise, connect to the target by typing: </P
153 CLASS="PROGRAMLISTING"
154 >(gdb) set remotebaud 38400
155 (gdb) target remote /dev/ttyS0</PRE
168 CLASS="PROGRAMLISTING"
169 >(gdb) set remotebaud 38400
170 (gdb) target remote com1</PRE
183 CLASS="PROGRAMLISTING"
184 >(gdb) target sim</PRE
189 >to use a simulator in either host O/S.</P
191 >Check the documentation for the target board for the actual baud rate
192 to use when connecting to real targets.</P
194 >You will see output similar to the following: </P
202 CLASS="PROGRAMLISTING"
203 >Remote debugging using /dev/ttyS1
213 ><version></I
215 >/src/common/kapi.cxx:345
217 Current language: auto; currently c++
223 >Or if you are using the simulator:</P
231 CLASS="PROGRAMLISTING"
232 >Connected to the simulator.
238 >Now download the program to the target with</P
246 CLASS="PROGRAMLISTING"
252 >You should see output similar to the following on your screen: </P
260 CLASS="PROGRAMLISTING"
261 >Loading section .text, size 0x4b04 lma 0x108000
262 Loading section .rodata, size 0x738 lma 0x10cb08
263 Loading section .data, size 0x1c0 lma 0x10d240
264 Start address 0x108000, load size 21500
265 Transfer rate: 24571 bits/sec, 311 bytes/write.
271 >You are now ready to run your program. If you type: </P
279 CLASS="PROGRAMLISTING"
285 >you will see output similar to the following: </P
293 CLASS="PROGRAMLISTING"
295 PASS:<Binary Semaphore 0 OK>
296 EXIT:<done></PRE
307 > If you are using a simulator or the synthetic target rather
308 than real hardware, you must use the GDB command
309 “run” rather than “continue” to
310 start your program.</P
314 >You can terminate your GDB session with
321 >, otherwise it will sit in the
322 “idle” thread and use up CPU time. This is not a problem
323 with real targets, but may have undesirable effects in simulated or
324 synthetic targets. Type <B
335 SUMMARY="Footer navigation table"
346 HREF="running-an-ecos-test-case.html"
355 HREF="ecos-user-guide.html"
364 HREF="testing-filters.html"
383 HREF="running-an-ecos-test-case.html"