Add documentation on providing the 'cd' and 'pwd' commands to lldb with the help of the embedded Python interpreter and

the 'command regex' command.

llvm-svn: 141698
This commit is contained in:
Johnny Chen 2011-10-11 19:39:48 +00:00
parent 9d7c1a2a18
commit ef9e2ef2a5
1 changed files with 17 additions and 0 deletions

View File

@ -431,3 +431,20 @@ Finally, the results of the expressions are stored in persistent variables
(lldb) expr self = $0
$4 = (SKTGraphicView *) 0x0000000100135430
f) Miscellaneous:
You can use the embedded Python interprter to add the following 'pwd' and 'cd' commands
for your lldb session:
(lldb) script import os
(lldb) command alias pwd script print os.getcwd()
(lldb) command regex cd "s/^(.*)$/script os.chdir(os.path.expanduser('%1'))/"
...
(lldb) cd /tmp
script os.chdir(os.path.expanduser('/tmp'))
(lldb) pwd
/private/tmp
(lldb)