XCode Debugging with lldb - how to view contents of array/matrix

Discussion in 'Mac Programming' started by rdlatimer, Aug 8, 2014.

  1. rdlatimer macrumors newbie

    Joined:
    Aug 8, 2014
    #1
    I would like to view the entire contents of an array (1D) and matrix (2D) using the debugger in XCode - lldb.
    I created these array/matrices using pointers and malloc(). The debugger shows the first element of the array/matrix, how do I view the entire contents of these arrays/matrices.
    Thanks for any help.
     
  2. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #2
    I don't have a Mac in front of me at the moment to try it. But I know the 'gdb' command to dump the information. 'lldb' is probably similar.

    Try:

    PHP:
    x/5i ptr
    That would dump memory at pointer 'ptr' with 5 integers. You can replace the 5 with whatever count you want. You can replace the 'i' with other units like 'u' unsigned, 'x' hex, etc.
     
  3. rdlatimer thread starter macrumors newbie

    Joined:
    Aug 8, 2014
    #3
    Thanks, I'll try that, and I'll let you know how it works out.
     

Share This Page