<p>Forgive me for a potentially silly question here, but in other programming languages (scripting ones like PHP or Perl) it is often easy to dump everything contained within a variable.</p>

<p>For instance, in PHP there are the <code>var_dump()</code> or <code>print_r()</code> functions. Perl has the <code>Data::Dumper</code> CPAN class, etc etc.</p>

<p>Is there something like this for Objective-C? It would be very convenient in a few cases to be able to dump everything like that, instead of using gdb to inspect each variable.</p>

Use NSLog() to dump contents of objects. For example:
```
```
NSData* myData = //... assume this exists
NSLog(@"Contents of myData: %@", myData);
```
```
NSLog has a printf-style format string (expects an NSString object) followed by a variable list of parameters, just like printf. The replacement character %@ represents an object the description method on an object. This is useful for dumping most Objective-C objects in Cocoa.
If you want to dump the contents of an object using gdb (I see you tagged this with gdb), use the special "po" directive instead of print. For example:
```
```
gdb) po myData
```
```
will cause gdb to dump the myData object. po is a shortcut for print-object.