title: Evaluate an expression in gdb and lldb
body: <p>I'm trying to understand GDB and LLDB so that I can efficiently used it to debug my Programs at any point. </p>
  
  <p>But it seem that I'm stuck I'm not sure how to print the output of C library function like <code>pow</code>, <code>strnlen</code> etc. If I ever want to explore there output.</p>
  
  <p>Following are by LLDB and GDB output.</p>
  
  <pre><code>   3    int main(int argc,char *argv[]) {
     4       int a = pow(3,2);
  -&gt; 5       printf("the value of a is %d",a);
     6       return 0;
     7    }
  (lldb) print pow(3,1)
  warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.
  error: 'pow' has unknown return type; cast the call to its declared return type
  (lldb) print strlen("abc")
  warning: could not load any Objective-C class information. This will significantly reduce the quality of type information available.
  error: 'strlen' has unknown return type; cast the call to its declared return type
  (lldb) expr int a = strlen("abc");
  error: 'strlen' has unknown return type; cast the call to its declared return type
  (lldb) expr int a = strlen("abc");
  </code></pre>
  
  <p>GDB output</p>
  
  <pre><code>Starting program: /Users/noobie/workspaces/myWork/pow 
  [New Thread 0x1903 of process 35243]
  warning: unhandled dyld version (15)
  
  Thread 2 hit Breakpoint 1, main (argc=1, argv=0x7fff5fbffb10) at pow.c:5
  5      int a = pow(3,2);
  (gdb) print pow(3,2)
  No symbol "pow" in current context.
  (gdb) set pow(3,2)
  No symbol "pow" in current context.
  (gdb) set pow(3,2);
  No symbol "pow" in current context.
  (gdb) print pow(3,2);
  No symbol "pow" in current context.
  (gdb) call pow(3,2)
  No symbol "pow" in current context.
  (gdb) 
  </code></pre>
  
  <p>I have compiled the program using gcc with -g3 flag </p>
  
  <p>i.e</p>
  
  <blockquote>
    <p>gcc -g3 pow.c -o pow</p>
  </blockquote>