简体   繁体   English

C-如何在Xcode的调试器中将指向字符串数组的指针作为数组查看

[英]C - How to view pointer to array of strings as array in Xcode's debugger

So I have char **sentence with sentence[0] = string0, sentence[1] = string1 , etc. Is there a way I can print the entire array in lldb? 所以我有char **sentencesentence[0] = string0, sentence[1] = string1 ,等等。有没有办法可以在lldb中打印整个数组? So that it shows up as {string0, string1, ...} 这样它就显示为{string0, string1, ...}

This is answered in: 可以通过以下方式回答:

View array in LLDB: equivalent of GDB's '@' operator in Xcode 4.1 LLDB中的视图数组:与Xcode 4.1中GDB的'@'运算符等效

particularly, you can use the parray command in any recent lldb. 特别是,您可以在任何最近的lldb中使用parray命令。

There isn't a way to do this in the Xcode Locals view, but you can do this in the Xcode Debugger Console. 在Xcode Locals视图中无法执行此操作,但是您可以在Xcode Debugger Console中执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM