blob: 6381f0d8c8e6dab12181669c3f97918c85c3b1b3 [file] [log] [blame]
Greg Claytonf9ab5ea2012-01-22 02:55:08 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5<link href="style.css" rel="stylesheet" type="text/css" />
Greg Claytonf3edcc02012-01-26 00:32:22 +00006<title>LLDB Python Reference</title>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +00007</head>
8
9<body>
10 <div class="www_title">
Greg Claytonf3edcc02012-01-26 00:32:22 +000011 LLDB Python Reference
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000012 </div>
13
14<div id="container">
15 <div id="content">
16 <!--#include virtual="sidebar.incl"-->
17 <div id="middle">
18 <div class="post">
19 <h1 class ="postheader">Introduction</h1>
20 <div class="postcontent">
21
Jim Ingham062a8362012-01-24 02:40:42 +000022 <p>The entire LLDB API is available as Python functions through a script bridging interface.
23 This means the LLDB API's can be used directly from python either interactively or to build python apps that
24 provide debugger features. </p>
25 <p>Additionally, Python can be used as a programmatic interface within the
26 lldb command interpreter (we refer to this for brevity as the embedded interpreter). Of course,
27 in this context it has full access to the LLDB API - with some additional conveniences we will
28 call out in the FAQ.</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000029
30 </div>
31 <div class="postfooter"></div>
32
33 <div class="post">
34 <h1 class ="postheader">Embedded Python Interpreter</h1>
35 <div class="postcontent">
36
Jim Ingham062a8362012-01-24 02:40:42 +000037 <p>The embedded python interpreter can be accessed in a variety of ways from within LLDB. The
38 easiest way is to use the lldb command <b>script</b> with no arguments at the lldb command prompt:</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000039<code><pre><tt>(lldb) <strong>script</strong>
40Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
41>>> 2+3
425
43>>> hex(12345)
44'0x3039'
45>>>
46</tt></pre></code>
47
Jim Ingham062a8362012-01-24 02:40:42 +000048 <p>This drops you into the embedded python interpreter. When running under the <b>script</b> command,
49 lldb sets some convenience variables that give you quick access to the currently selected entities that characterize
50 the program and debugger state. In each case, if there is no currently selected entity of the appropriate
51 type, the variable's <b>IsValid</b> method will return false.
52 <p>Note also, these variables hold the values
53 of the selected objects on entry to the embedded interpreter. They do not update as you use the LLDB
54 API's to change, for example, the currently selected stack frame or thread.</p>
55 These are all global variables contained in the <b>lldb</b> python namespace :</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000056 <table class="stats" width="620" cellspacing="0">
57 <tr>
58 <td class="hed" width="20%">Variable</td>
59 <td class="hed" width="10%">Type</td>
60 <td class="hed" width="70%">Description</td>
61 </tr>
62
63 <tr>
64 <td class="content">
65 <b>lldb.debugger</b>
66 </td>
67 <td class="content">
68 <b>lldb.SBDebugger</b>
69 </td>
70 <td class="content">
Jim Ingham062a8362012-01-24 02:40:42 +000071 Contains the debugger object whose <b>script</b> command was invoked.
72 The <b>lldb.SBDebugger</b> object owns the command interpreter
73 and all the targets in your debug session. There will always be a
74 Debugger in the embedded interpreter.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000075 </td>
76 </tr>
77 <tr>
78 <td class="content">
79 <b>lldb.target</b>
80 </td>
81 <td class="content">
82 <b>lldb.SBTarget</b>
83 </td>
84 <td class="content">
Jim Ingham062a8362012-01-24 02:40:42 +000085 Contains the currently selected target - for instance the one made with the
86 <b>file</b> or selected by the <b>target select &lt;target-index&gt;</b> command.
87 The <b>lldb.SBTarget</b> manages one running process, and all the executable
88 and debug files for the process.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +000089 </td>
90 </tr>
91 <tr>
92 <td class="content">
93 <b>lldb.process</b>
94 </td>
95 <td class="content">
96 <b>lldb.SBProcess</b>
97 </td>
98 <td class="content">
Jim Ingham062a8362012-01-24 02:40:42 +000099 Contains the process of the currently selected target.
100 The <b>lldb.SBProcess</b> object manages the threads and allows access to
101 memory for the process.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000102 </td>
103 </tr>
104 <tr>
105 <td class="content">
106 <b>lldb.thread</b>
107 </td>
108 <td class="content">
109 <b>lldb.SBThread</b>
110 </td>
111 <td class="content">
Jim Ingham062a8362012-01-24 02:40:42 +0000112 Contains the currently selected thread.
113 The <b>lldb.SBThread</b> object manages the stack frames in that thread.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000114 A thread is always selected in the command interpreter when a target stops.
115 The <b>thread select &lt;thread-index&gt;</b> commmand can be used to change the
Jim Ingham062a8362012-01-24 02:40:42 +0000116 currently selected thread. So as long as you have a stopped process, there will be
117 some selected thread.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000118 </td>
119 </tr>
120 <tr>
121 <td class="content">
122 <b>lldb.frame</b>
123 </td>
124 <td class="content">
125 <b>lldb.SBFrame</b>
126 </td>
127 <td class="content">
Jim Ingham062a8362012-01-24 02:40:42 +0000128 Contains the currently selected stack frame.
129 The <b>lldb.SBFrame</b> object manage the stack locals and the register set for
130 that stack.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000131 A stack frame is always selected in the command interpreter when a target stops.
132 The <b>frame select &lt;frame-index&gt;</b> commmand can be used to change the
Jim Ingham062a8362012-01-24 02:40:42 +0000133 currently selected frame. So as long as you have a stopped process, there will
134 be some selected frame.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000135 </td>
136 </tr>
137 </table>
138
Jim Ingham062a8362012-01-24 02:40:42 +0000139 <p>Once in the embedded interpreter, these objects can be used. To get started, note that almost
140 all of the <b>lldb</b> Python objects are able to briefly describe themselves when you pass them
141 to the Python <b>print</b> function:
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000142<code><pre><tt>(lldb) <b>script</b>
143Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
144>>> <strong>print lldb.debugger</strong>
145Debugger (instance: "debugger_1", id: 1)
146>>> <strong>print lldb.target</strong>
147a.out
148>>> <strong>print lldb.process</strong>
149SBProcess: pid = 59289, state = stopped, threads = 1, executable = a.out
150>>> <strong>print lldb.thread</strong>
151SBThread: tid = 0x1f03
152>>> <strong>print lldb.frame</strong>
153frame #0: 0x0000000100000bb6 a.out main + 54 at main.c:16
154</tt></pre></code>
155
156 </div>
157 <div class="postfooter"></div>
158
159 </div>
160 <div class="post">
161 <h1 class ="postheader">Running a Python script when a breakpoint gets hit</h1>
162 <div class="postcontent">
163
Jim Ingham062a8362012-01-24 02:40:42 +0000164 <p>One very powerful use of the lldb Python API is to have a python script run when a breakpoint gets hit. Adding python
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000165 scripts to breakpoints provides a way to create complex breakpoint
166 conditions and also allows for smart logging and data gathering.</p>
Jim Ingham062a8362012-01-24 02:40:42 +0000167 <p>When your process hits a breakpoint to which you have attached some python code, the code is executed as the
168 body of a function which takes two arguments:</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000169 <p>
Jim Ingham062a8362012-01-24 02:40:42 +0000170<code><pre><tt>def breakpoint_function_wrapper(<b>frame</b>, <b>bp_loc</b>):
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000171 <font color=green># Your code goes here</font>
172</tt></pre></code>
173 <p><table class="stats" width="620" cellspacing="0">
174 <tr>
175 <td class="hed" width="10%">Argument</td>
176 <td class="hed" width="10%">Type</td>
177 <td class="hed" width="80%">Description</td>
178 </tr>
179
180 <tr>
181 <td class="content">
182 <b>frame</b>
183 </td>
184 <td class="content">
185 <b>lldb.SBFrame</b>
186 </td>
187 <td class="content">
188 The current stack frame where the breakpoint got hit.
Jim Ingham062a8362012-01-24 02:40:42 +0000189 The object will always be valid.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000190 This <b>frame</b> argument might <i>not</i> match the currently selected stack frame found in the <b>lldb</b> module global variable <b>lldb.frame</b>.
191 </td>
192 </tr>
193 <tr>
194 <td class="content">
195 <b>bp_loc</b>
196 </td>
197 <td class="content">
198 <b>lldb.SBBreakpointLocation</b>
199 </td>
200 <td class="content">
201 The breakpoint location that just got hit. Breakpoints are represented by <b>lldb.SBBreakpoint</b>
202 objects. These breakpoint objects can have one or more locations. These locations
203 are represented by <b>lldb.SBBreakpointLocation</b> objects.
204 </td>
205 </tr>
206 </table>
Jim Ingham062a8362012-01-24 02:40:42 +0000207 <p>An example will show how simple it is to write some python code and attach it to a breakpoint.
208 The following example will allow you to track the order in which the functions in a given shared library
209 are first executed during one run of your program. This is a simple method to gather an order file which
210 can be used to optimize function placement within a binary for execution locality.</p>
211 <p>We do this by setting a regular expression breakpoint
212 that will match every function in the shared library. The regular expression '.' will match
213 any string that has at least one character in it, so we will use that.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000214 This will result in one <b>lldb.SBBreakpoint</b> object
Jim Ingham062a8362012-01-24 02:40:42 +0000215 that contains an <b>lldb.SBBreakpointLocation</b> object for each function. As the breakpoint gets
216 hit, we use a counter to track the order in which the function at this particular breakpoint location got hit.
217 Since our code is passed the location that was hit, we can get the name of the function from the location,
218 disable the location so we won't count this function again; then log some info and continue the process.</p>
219 <p>Note we also have to initialize our counter, which we do with the simple one-line version of the <b>script</b>
220 command.
221 <p>Here is the code:
222
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000223<code><pre><tt>(lldb) <strong>breakpoint set --func-regex=. --shlib=libfoo.dylib</strong>
224Breakpoint created: 1: regex = '.', module = libfoo.dylib, locations = 223
Jim Ingham062a8362012-01-24 02:40:42 +0000225(lldb) <strong>script counter = 0</strong>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000226(lldb) <strong>breakpoint command add --script-type python 1</strong>
227Enter your Python command(s). Type 'DONE' to end.
Jim Ingham062a8362012-01-24 02:40:42 +0000228> <font color=green># Increment our counter. Since we are in a function, this must be a global python variable</font>
229> <strong>global counter</strong>
230> <strong>counter += 1</strong>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000231> <font color=green># Get the name of the function</font>
232> <strong>name = frame.GetFunctionName()</strong>
233> <font color=green># Print the order and the function name</font>
Jim Ingham062a8362012-01-24 02:40:42 +0000234> <strong>print '[%i] %s' % (counter, name)</strong>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000235> <font color=green># Disable the current breakpoint location so it doesn't get hit again</font>
236> <strong>bp_loc.SetEnabled(False)</strong>
237> <font color=green># How continue the process</font>
238> <strong>frame.GetThread().GetProcess().Continue()</strong>
239> <strong>DONE</strong>
240</tt></pre></code>
241 <p>The <b>breakpoint command add</b> command above attaches a python script to breakpoint 1.
242 To remove the breakpoint command:
243 <p><code>(lldb) <strong>breakpoint command delete 1</strong></code>
244 </div>
245 </div>
246 <div class="post">
247 <h1 class ="postheader">Create a new LLDB command using a python function</h1>
248 <div class="postcontent">
249
Jim Ingham062a8362012-01-24 02:40:42 +0000250 <p>Python functions can be used to create new LLDB command interpreter commands, which will work
251 like all the natively defined lldb commands. This provides a very flexible and easy way to extend LLDB to meet your
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000252 debugging requirements. </p>
Jim Ingham062a8362012-01-24 02:40:42 +0000253 <p>To write a python function that implements a new LDB command define the function to take four arguments as follows:</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000254
255 <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
256 <font color=green># Your code goes here</font>
257 </tt></pre></code>
Enrico Granatac0791aa2012-05-02 21:00:41 +0000258
259 Optionally, you can also provide a Python docstring, and LLDB will use it when providing help for your command, as in:
260 <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
261 <font color=green>"""This command takes a lot of options and does many fancy things"""</font>
262 <font color=green># Your code goes here</font>
263 </tt></pre></code>
264
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000265 <p><table class="stats" width="620" cellspacing="0">
266 <tr>
267 <td class="hed" width="10%">Argument</td>
268 <td class="hed" width="10%">Type</td>
269 <td class="hed" width="80%">Description</td>
270 </tr>
271
272 <tr>
273 <td class="content">
274 <b>debugger</b>
275 </td>
276 <td class="content">
277 <b>lldb.SBDebugger</b>
278 </td>
279 <td class="content">
280 The current debugger object.
281 </td>
282 </tr>
283 <tr>
284 <td class="content">
285 <b>command</b>
286 </td>
287 <td class="content">
288 <b>python string</b>
289 </td>
290 <td class="content">
291 A python string containing all arguments for your command. If you need to chop up the arguments
292 try using the <b>shlex</b> module's <code>shlex.split(command)</code> to properly extract the
293 arguments.
294 </td>
295 </tr>
296 <tr>
297 <td class="content">
298 <b>result</b>
299 </td>
300 <td class="content">
301 <b>lldb.SBCommandReturnObject</b>
302 </td>
303 <td class="content">
304 A return object where you can indicate the success or failure of your command. You can also
305 provide information for the command result by printing data into it. You can also just print
Jim Ingham062a8362012-01-24 02:40:42 +0000306 data as you normally would in a python script and the output will show up; this is useful for
307 logging, but the real output for your command should go in the result object.
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000308 </td>
309 </tr>
310 <tr>
311 <td class="content">
312 <b>dict</b>
313 </td>
314 <td class="content">
315 <b>python dict object</b>
316 </td>
317 <td class="content">
318 The dictionary for the current embedded script session which contains all variables
319 and functions.
320 </td>
321 </tr>
322 </table>
Jim Ingham062a8362012-01-24 02:40:42 +0000323 <p>One other handy convenience when defining lldb command-line commands is the command
324 <b>command script import</b> which will import a module specified by file path - so you
325 don't have to change your PYTHONPATH for temporary scripts. It also has another convenience
326 that if your new script module has a function of the form:</p>
327
Enrico Granata8e1d33f2012-02-20 22:05:47 +0000328<code><pre><tt>def __lldb_init_module(<b>debugger</b>, <b>dict</b>):
Greg Clayton261c9742012-01-26 05:36:07 +0000329 <font color=green># Command Initialization code goes here</font>
330</tt></pre></code>
Jim Ingham062a8362012-01-24 02:40:42 +0000331
332 <p>where <b>debugger</b> and <b>dict</b> are as above, that function will get run when the module is loaded
Greg Clayton261c9742012-01-26 05:36:07 +0000333 allowing you to add whatever commands you want into the current debugger. Note that
334 this function will only be run when using the LLDB comand <b>command script import</b>,
335 it will not get run if anyone imports your module from another module.
336 If you want to always run code when your module is loaded from LLDB
337 <u>or</u> when loaded via an <b>import</b> statement in python code
338 you can test the <b>lldb.debugger</b> object, since you imported the
339 <lldb> module at the top of the python <b>ls.py</b> module. This test
340 must be in code that isn't contained inside of any function or class,
341 just like the standard test for <b>__main__</b> like all python modules
342 usally do. Sample code would look like:
343
344<code><pre><tt>if __name__ == '__main__':
345 <font color=green># Create a new debugger instance in your module if your module
346 # can be run from the command line. When we run a script from
347 # the command line, we won't have any debugger object in
348 # lldb.debugger, so we can just create it if it will be needed</font>
349 lldb.debugger = lldb.SBDebugger.Create()
350elif lldb.debugger:
351 <font color=green># Module is being run inside the LLDB interpreter</font>
352 lldb.debugger.HandleCommand('command script add -f ls.ls ls')
353 print 'The "ls" python command has been installed and is ready for use.'
354</tt></pre></code>
355 <p>Now we can create a module called <b>ls.py</b> in the file <b>~/ls.py</b> that will implement a function that
Jim Ingham062a8362012-01-24 02:40:42 +0000356 can be used by LLDB's python command code:</p>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000357
358<code><pre><tt><font color=green>#!/usr/bin/python</font>
359
360import lldb
361import commands
362import optparse
363import shlex
364
365def ls(debugger, command, result, dict):
Jim Ingham062a8362012-01-24 02:40:42 +0000366 result.PutCString(commands.getoutput('/bin/ls %s' % command))
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000367
Jim Ingham062a8362012-01-24 02:40:42 +0000368<font color=green># And the initialization code to add your commands </font>
Enrico Granata8e1d33f2012-02-20 22:05:47 +0000369def __lldb_init_module(debugger, dict):
Jim Ingham062a8362012-01-24 02:40:42 +0000370 debugger.HandleCommand('command script add -f ls.ls ls')
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000371 print 'The "ls" python command has been installed and is ready for use.'
372</tt></pre></code>
373 <p>Now we can load the module into LLDB and use it</p>
374<code><pre><tt>% lldb
Greg Clayton261c9742012-01-26 05:36:07 +0000375(lldb) <strong>command script import ~/ls.py</strong>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000376The "ls" python command has been installed and is ready for use.
377(lldb) <strong>ls -l /tmp/</strong>
378total 365848
379-rw-r--r--@ 1 someuser wheel 6148 Jan 19 17:27 .DS_Store
380-rw------- 1 someuser wheel 7331 Jan 19 15:37 crash.log
381</tt></pre></code>
382 <p>A template has been created in the source repository that can help you to create
383 lldb command quickly:</p>
384 <a href="http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/cmdtemplate.py">cmdtemplate.py</a>
385 </div>
386 <div class="post">
387 <h1 class ="postheader">Using the lldb.py module in python</h1>
388 <div class="postcontent">
389
390 <p>LLDB has all of its core code build into a shared library which gets
391 used by the <b>lldb</b> command line application. On Mac OS X this
392 shared library is a framework: <b>LLDB.framework</b> and on other
Jim Ingham062a8362012-01-24 02:40:42 +0000393 unix variants the program is a shared library: <b>lldb.so</b>. LLDB also
394 provides an lldb.py module that contains the bindings from LLDB into Python.
395 To use the
396 <b>LLDB.framework</b> to create your own stand-alone python programs, you will
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000397 need to tell python where to look in order to find this module. This
Jim Ingham062a8362012-01-24 02:40:42 +0000398 is done by setting the <b>PYTHONPATH</b> environment variable, adding
399 a path to the directory that contains the <b>lldb.py</b> python module. On
400 Mac OS X, this is contained inside the LLDB.framework, so you would do:
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000401
402 <p>For csh and tcsh:</p>
403 <p><code>% <b>setenv PYTHONPATH /Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Python</b></code></p>
404 <p>For sh and bash:
405 <p><code>% <b>export PYTHONPATH=/Developer/Library/PrivateFrameworks/LLDB.framework/Resources/Python</b></code></p>
406
Jim Ingham062a8362012-01-24 02:40:42 +0000407 <p> Alternately, you can append the LLDB Python directory to the <b>sys.path</b> list directly in
408 your Python code before importing the lldb module.</p>
409
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000410 <p>
411 Now your python scripts are ready to import the lldb module. Below is a
412 python script that will launch a program from the current working directory
413 called "a.out", set a breakpoint at "main", and then run and hit the breakpoint,
414 and print the process, thread and frame objects if the process stopped:
415
416 </p>
417<code><pre><tt><font color=green>#!/usr/bin/python</font>
418
419import lldb
420
421<font color=green># Set the path to the executable to debug</font>
422exe = "./a.out"
423
424<font color=green># Create a new debugger instance</font>
425debugger = lldb.SBDebugger.Create()
426
427<font color=green># When we step or continue, don't return from the function until the process
Jim Ingham062a8362012-01-24 02:40:42 +0000428# stops. Otherwise we would have to handle the process events ourselves which, while doable is
429#a little tricky. We do this by setting the async mode to false.</font>
Greg Claytonf9ab5ea2012-01-22 02:55:08 +0000430debugger.SetAsync (False)
431
432<font color=green># Create a target from a file and arch</font>
433print "Creating a target for '%s'" % exe
434
435target = debugger.CreateTargetWithFileAndArch (exe, lldb.LLDB_ARCH_DEFAULT)
436
437if target:
438 <font color=green># If the target is valid set a breakpoint at main</font>
439 main_bp = target.BreakpointCreateByName ("main", target.GetExecutable().GetFilename());
440
441 print main_bp
442
443 <font color=green># Launch the process. Since we specified synchronous mode, we won't return
444 # from this function until we hit the breakpoint at main</font>
445 process = target.LaunchSimple (None, None, os.getcwd())
446
447 <font color=green># Make sure the launch went ok</font>
448 if process:
449 <font color=green># Print some simple process info</font>
450 state = process.GetState ()
451 print process
452 if state == lldb.eStateStopped:
453 <font color=green># Get the first thread</font>
454 thread = process.GetThreadAtIndex (0)
455 if thread:
456 <font color=green># Print some simple thread info</font>
457 print thread
458 <font color=green># Get the first frame</font>
459 frame = thread.GetFrameAtIndex (0)
460 if frame:
461 <font color=green># Print some simple frame info</font>
462 print frame
463 function = frame.GetFunction()
464 <font color=green># See if we have debug info (a function)</font>
465 if function:
466 <font color=green># We do have a function, print some info for the function</font>
467 print function
468 <font color=green># Now get all instructions for this function and print them</font>
469 insts = function.GetInstructions(target)
470 disassemble_instructions (insts)
471 else:
472 <font color=green># See if we have a symbol in the symbol table for where we stopped</font>
473 symbol = frame.GetSymbol();
474 if symbol:
475 <font color=green># We do have a symbol, print some info for the symbol</font>
476 print symbol
477</tt></pre></code>
478 </div>
479 <div class="postfooter"></div>
480
481 </div>
482 </div>
483</div>
484</body>
485</html>