Lines Matching full:python
1 Python Scripting
5 ways -- a Unix Python session can initiate/run a debug session
6 non-interactively using LLDB; and within the LLDB debugger tool, Python
11 Python scripting to find a bug in a program that searches for text in a
56 impractical. Therefore we will write a Python script to search the tree
62 Python would look like, with line numbers added for easy reference in
97 Before we can call any Python function on any of our program's
98 variables, we need to get the variable into a form that Python can
101 binary search tree, put into a Python variable. The second parameter is
106 The most interesting parameter is the first one, the Python variable
108 variable out of our program and put it into a Python variable? What
109 kind of Python variable will it be? The answers are to use the LLDB API
110 functions, provided as part of the LLDB Python module. Running Python
112 object as a Python variable, "lldb.frame". This variable has the type
117 variable as a Python variable:
123 The line above, executed in the Python script interpreter in LLDB, asks the
125 store the returned value in the Python variable named "root". This answers the
155 current node and store them in Python variables. Since root_word_ptr is a
164 pointer child is NULL ("None" is the Python equivalent of NULL). If the left
175 tree_utils.py) and then importing it into your LLDB Python interpreter.
209 Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
222 and drop into the embedded interactive Python interpreter. We will go over this
223 Python code line by line. The first line
230 imports the file where we wrote our DFS function, tree_utils.py, into Python.
233 Python knows where to look for the function. The line
241 and puts it into the Python variable "root". See Accessing & Manipulating
242 Program Variables in Python above for more details about how this works. The
258 calls our DFS function (prefixing it with the module name so that Python can
261 function returns to the Python variable path.
285 attach a Python breakpoint command script to each breakpoint. The breakpoint
286 commands will use the global path Python variable that we got from our DFS
296 Python Breakpoint Command Scripts Are Not What They Seem
299 What do we mean by that? When you enter a Python breakpoint command in LLDB, it
300 appears that you are entering one or more plain lines of Python. BUT LLDB then
301 takes what you entered and wraps it into a Python FUNCTION (just like using the
302 "def" Python command). It automatically gives the function an obscure, unique,
306 was hit, and puts them into Python variables for you. It then calls the Python
310 So, being practical, what does this mean for you when you write your Python
312 mind: 1. If you want to access any Python variables created outside your
314 them as global, then the Python function will treat them as local variables,
315 and you will get unexpected behavior. 2. All Python breakpoint command scripts
323 This is what the Python breakpoint command script would look like for the
354 (and therefore outside of the corresponding function) we need to tell Python
411 (lldb) breakpoint command add -s python 2
412 Enter your Python command(s). Type 'DONE' to end.
422 (lldb) breakpoint command add -s python 3
423 Enter your Python command(s). Type 'DONE' to end.
465 going right would be the correct decision. Let's ask Python what it thinks the
473 According to Python we need to go left-left-right-right-left from our current
486 This is the end of our example on how you might use Python scripting in LLDB to
493 DFS function and other Python script examples (tree_utils.py) used for this
496 tree_utils.py - Example Python functions using LLDB's API, including DFS
501 # ===-- tree_utils.py ---------------------------------------*- Python -*-===//
512 functions, and assume that the LLDB Python module has been