title: iOS lldb function lookup
body: <p>I am trying to learn how to debug iOS apps on my jailbroken iOS device using lldb.</p>
  
  <p>I can't seem to figure out why lldb is not able to get functions when gdb is able to. For example, I am trying to find out what is the _mh_execute_header address.</p>
  
  <p>On GDB</p>
  
  <pre><code>(gdb) info func _mh_ex*
  All functions matching regular expression "_mh_ex*":
  
  Non-debugging symbols:
  0x000e5000  _mh_execute_header
  </code></pre>
  
  <p>On lldb</p>
  
  <pre><code>(lldb) image lookup -r -n _mh_e*
  (lldb) image lookup -r -s _mh_e*
  (lldb) 
  </code></pre>
  
  <p>I did some searching around and found this site: <a href="http://versprite.com/og/ios-reverse-engineering-part-one-configuring-lldb/" rel="nofollow">http://versprite.com/og/ios-reverse-engineering-part-one-configuring-lldb/</a> and followed its instructions.</p>
  
  <p>After executing the target create command:</p>
  
  <pre><code>(lldb) target create --arch arm Cood
  Current executable set to '/Users/tester/Desktop/Cood' (armv7).
  </code></pre>
  
  <p>I can do this</p>
  
  <pre><code>(lldb) image lookup -r -n _mh_e*
  (lldb) image lookup -r -s _mh_e*
  1 symbols match the regular expression '_mh_e*' in /Users/tester/Desktop/Cood:
      Address: Cood[0x00004000] (Cood.__TEXT + 0)
      Summary: Cood`_mh_execute_header
  </code></pre>
  
  <p>But then I execute process continue and I get</p>
  
  <pre><code>(lldb) process continue 
  error: invalid process
  </code></pre>
  
  <p>I have no idea what is going on. </p>
  
  <p>FYI, I executed the following commands on my Mac to connect to the iOS debug server (OS X Yosemite, Xcode 6.3.1, lldb-330.0.44)</p>
  
  <pre><code>(lldb) platform select remote-ios
  (lldb) process connect connect://127.0.0.1:7777
  (lldb) process attach -n Cood -w
  </code></pre>
  
  <p>Any help would be appreciated! Thank you.</p>