[Lldb-commits] [lldb] r141698 - /lldb/trunk/docs/lldb-for-gdb-users.txt

Johnny Chen johnny.chen at apple.com
Tue Oct 11 12:39:48 PDT 2011

Author: johnny
Date: Tue Oct 11 14:39:48 2011
New Revision: 141698

URL: http://llvm.org/viewvc/llvm-project?rev=141698&view=rev
Add documentation on providing the 'cd' and 'pwd' commands to lldb with the help of the embedded Python interpreter and
the 'command regex' command.


Modified: lldb/trunk/docs/lldb-for-gdb-users.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/lldb-for-gdb-users.txt?rev=141698&r1=141697&r2=141698&view=diff
--- lldb/trunk/docs/lldb-for-gdb-users.txt (original)
+++ lldb/trunk/docs/lldb-for-gdb-users.txt Tue Oct 11 14:39:48 2011
@@ -431,3 +431,20 @@
 (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

More information about the lldb-commits mailing list