Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between LLDB and GDB debuggers [duplicate]

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.

like image 848
user1899840 Avatar asked Dec 21 '12 04:12

user1899840


People also ask

What is the difference between GDB and LLDB?

GDB is part of the GNU framework, and was created to work alongside of g++ , which is the GNU C++ compiler. LLDB is part of the LLVM framework, and was created to work alongside of clang++ , which is the LLVM C++ compiler. Ideally, you would use the debugger of the same framework that the compiler is part of.

Is LLDB compatible with GDB?

The standard LLDB installation provides you with an extensive set of commands designed to be compatible with familiar GDB commands. In addition to using the standard configuration, you can easily customize LLDB to suit your needs. Both GDB and LLDB are of course excellent debuggers without doubt.

What is LLDB?

lldb is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator. All of the code in the LLDB project is available under the Apache 2.0 License with LLVM exceptions.

Does LLDB have Tui?

You can also expand the regsiters by register class: I'd like to know how to resize the various windows. If you resize the terminal, the size of the stack view pane seems to remain fixed, so the symbol names always end up truncated.


1 Answers

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

like image 136
Deepak Avatar answered Nov 05 '22 09:11

Deepak