12

Possible Duplicate:
GDB Vs LLDB debuggers

I want to know the difference between LLDB and GDB debugger in detail. Everywhere it is mentioned as "LLDB is faster and memory-efficient than GDB" . I want to know in what sense it is faster and memory efficient.

  1. When I use LLDB, in the variables view of the debug area , member variable of that particular class or view controller are not displayed(count). And to the local array when objects are added the objects are not displayed in variables view, but the number of object is displayed(count).

    example(in variables view):

    arrayOfComments NSMutableArray * 0x068a6700 1 Object

    ->NSArray NSArray

    ->NSObject

  2. When I use GDB, in the variables view of the debug area , member variable of that particular class or view controller are displayed. And to the local array when objects are added the objects as well as the count is displayed in variables view.

    example(in variables view):

    arrayOfComments __NSArrayM * 0x68d7970 1 Object

    ->0 Comment * 0x6804940 (the object is displayed here)

  3. I came across an article saying LLDB understands the dot syntax.

    po self.property

    But when I use it in GDB it works even for "po self.property.previousProperty'sProperty" but doesn't work in LLDB. so now how does LLDB understands dot syntax.

Please help.

Thank you.

Community
  • 1
  • 1
user1899840
  • 543
  • 2
  • 7
  • 19

2 Answers2

6

It depends on your compiler. I would recommend using the lldb debugger with the "Apple LLVM compiler 3.0", and gdb for GCC flavors (including "LLVM GCC 4.2").

Here are some links I have found useful for debugging:

http://lldb.llvm.org/tutorial.html

http://www.corbinstreehouse.com/blog/2007/10/instruments-on-leopard-how-to-debug-those-random-crashes-in-your-cocoa-app/

http://www.markj.net/iphone-memory-debug-nszombie/

http://www.cocoadev.com/index.pl?DebuggingAutorelease

I think these links may help you

Deepak
  • 1,278
  • 3
  • 15
  • 23
-2

"LLDB supports basic command line debugging & it is scriptable". LLDB also supports multithreaded debugging.Thus LLDB is much faster & efficient than GDB debugger.

Here I'm presenting the proof fpr this.

Launch a process no arguments.

GDB

(gdb) run

(gdb) r


LLVM

(lldb) process launch

(lldb) run

(lldb) r

You will get an exact idea, if you go through this The LLDB Debugger

Niru Mukund Shah
  • 4,637
  • 2
  • 20
  • 34