1

Is there a way to print an array slice in LLDB? For example, I have a C array of ints, and I want to see elements 3-5. I'm looking for something like p arr[3..5], but I cannot find the correct syntax.

Jongware
  • 22,200
  • 8
  • 54
  • 100
dacunni
  • 51
  • 6
  • 1
    Have a look at the various answers to http://stackoverflow.com/questions/7062173/lldb-equivalent-of-gdbs-operator-in-xcode-4-1. – Martin R Jun 05 '14 at 21:01

1 Answers1

1

parray, which takes a length and an array, will print an array. To print just a slice, offset the pointer and shorten the length:

parray 3 p+3
outis
  • 75,655
  • 22
  • 151
  • 221