1*87637809SJohnny ChenFiles in this directory: 2*87637809SJohnny Chen 3*87637809SJohnny Cheno .lldbinit: 4*87637809SJohnny Chen 5*87637809SJohnny ChenAn example lldb init file that imports the binutils.py module and adds the 6*87637809SJohnny Chenfollowing commands: 'itob' and 'utob'. 7*87637809SJohnny Chen 8*87637809SJohnny Cheno binutils.py: 9*87637809SJohnny Chen 10*87637809SJohnny ChenPython module which provides implementation for the 'itob' and 'utob' commands. 11*87637809SJohnny Chen 12*87637809SJohnny Cheno README: 13*87637809SJohnny Chen 14*87637809SJohnny ChenThe file you are reading now. 15*87637809SJohnny Chen 16*87637809SJohnny Chen================================================================================ 17*87637809SJohnny ChenThe following terminal output shows an interaction with lldb using the .lldbinit 18*87637809SJohnny Chenand the binutils.py files which are located in my HOME directory. The lldb init 19*87637809SJohnny Chenfile imports the utils Python module and adds the 'itob' and 'utob' commands. 20*87637809SJohnny Chen 21*87637809SJohnny Chen$ /Volumes/data/lldb/svn/trunk/build/Debug/lldb 22*87637809SJohnny Chen(lldb) help itob 23*87637809SJohnny ChenConvert the integer to print its two's complement representation. 24*87637809SJohnny Chen args[0] (mandatory) is the integer to be converted 25*87637809SJohnny Chen args[1] (mandatory) is the bit width of the two's complement representation 26*87637809SJohnny Chen args[2] (optional) if specified, turns on verbose printing 27*87637809SJohnny ChenSyntax: itob 28*87637809SJohnny Chen(lldb) itob -5 4 29*87637809SJohnny Chen [1, 0, 1, 1] 30*87637809SJohnny Chen(lldb) itob -5 32 v 31*87637809SJohnny Chen 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 32*87637809SJohnny Chen [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1] 33*87637809SJohnny Chen(lldb) utob 0xABCD 32 v 34*87637809SJohnny Chen 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 35*87637809SJohnny Chen [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1] 36*87637809SJohnny Chen(lldb) 37