How do I tell gdb how long my zero-length array is?

Posted by Joe on Stack Overflow See other posts from Stack Overflow or by Joe
Published on 2011-02-13T00:36:28Z Indexed on 2011/02/13 23:25 UTC
Read the original article Hit count: 168

Filed under:
|
|
|
|

Slightly oxymoronic title! Bonus points for Xcode answer but it's a gdb question.

If I have a standard, statically sized array gdb will print all its elements [and Xcode will let me browse through it] but if I have a zero length array, it won't, because it doesn't know. Obviously I can print the array indexes one by one, but I'd like a dump of the whole thing.

How do I tell gdb how much space I have allocated for the array to allow it to print the array (or to allow Xcode to view the array). Is it even possible?

© Stack Overflow or respective owner

Related posts about c

    Related posts about xcode