Jas*_*oco 33
在调试控制台中,您可以通过执行以下操作来获取字符串值:
(gdb) print (void)CFShow(myCFString)
要么:
(gdb) po (NSString*)myCFString
Either of those will display the entire string's contents to the debugging console. It's probably the easiest way to deal with large, variable-length strings or data structures of any kind.
For more information, the print
poprint-object command in the debugger basically dumps some data structure to the console. You can also call any functions or whatever, but since print doesn't have access to the function declarations, you have to make sure you provide them implicitly (as shown in the example above), or the print command will complain.
(gdb) print (const char *)[[theObject debugDescription] UTF8String]
This is really useful for examining things like NSData is a shortcut for (gdb) print (void)CFShow(myCFString) and is the same as print except for Objective-C objects. It basically functions like this:
(gdb) po (NSString*)myCFString
Either of those will display the entire string's contents to the debugging console. It's probably the easiest way to deal with large, variable-length strings or data structures of any kind.
For more information, the print
poprint-object(gdb) print (const char *)[[theObject debugDescription] UTF8String]
This is really useful for examining things like NSData object and NSArray/NSDictionary objects.
(gdb) print (void)CFShow(myCFString) 命令也是.
在 xcode 6 调试控制台中从打印长字符串显示真正的长字符串使用方法
setting set target.max-string-summary-length 10000
Run Code Online (Sandbox Code Playgroud)
print或po命令打印你的字符串print my_string
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19155 次 |
| 最近记录: |