<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br><div>currently one way to obtain the result you want in LLDB is to exploit summaries</div><div><br></div><div>For example,</div><div><div></div></div><blockquote type="cite"><div><div>(lldb) frame variable</div><div>(int *) x = 0x00000001001008e0</div></div></blockquote><div><br></div><div>Let's say that x is a pointer to 10 integers. To show the values:</div><div><div></div></div><blockquote type="cite"><div><div>(lldb) type summary add -f ${var[0-9]} "int *"</div><div>(lldb) frame variable</div><div>(int *) x = 0x00000001001008e0 [0,1,2,3,4,5,6,7,8,9]</div></div></blockquote><div><br></div><div>Of course, you want to delete the summary after showing the variable, because not all int* are actually 10-element arrays.</div><div><br></div><div>Unfortunately, at present, trying this fails:</div><div><div></div></div><blockquote type="cite"><div><div>(lldb) frame variable x[0-9]</div><div>error: bitfield range 0-9 is not valid for "(int *) x"</div></div></blockquote><div><br></div><div>Some code infrastructure is in place to have the above work, but currently not all the pieces are linked to one another and some "glue code" is missing, so the debugger is unable to infer that the above probably meant "show x[0] thru x[9]", instead of "try to read bits 0 thru 9 of x" (but x is a non-scalar, so that raises an error)</div><div><br></div><div>If you are interested in looking at the details, <span class="Apple-style-span" style="font-family: Menlo; font-size: 12px; ">StackFrame::GetValueForVariableExpressionPath </span>and <span class="Apple-style-span" style="font-family: Menlo; font-size: 12px; ">ValueObject::GetValueForExpressionPath </span>are the places to look for implementation details and ideas.</div><div><br></div><div>Hope the above helps you.</div><div><br></div><div>Sincerely,<br><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-family: Helvetica; "><div><i>Enrico Granata</i></div></div></div><br><div><div>On Aug 15, 2011, at 10:25 PM, Martin Pavlovsky wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br><br>I would like to view an array of elements pointed to by a pointer. In GDB this can be done by treating the pointed memory as an artificial array of a given length using the operator '@' as<br><br>*pointer @ length<br><br>where length is the number of elements I want to view.<br><br>The above syntax does not work in LLDB supplied with Xcode 4.1. Is there any way how to accomplish the above in LLDB?<br><br>Kind Regards,<br>Martin Pavlovsky _______________________________________________<br>lldb-dev mailing list<br><a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br></blockquote></div></div></div><div><br></div></body></html>