看到第六章关于传递参数与返回值,想试一下打印参数,遇到了点问题,lldb如下:
Process 980 stopped
- thread #1: tid = 0x17e7d, 0x0000000103342b2c test.dylib
objc_msgSend, queue = 'com.apple.main-thread', stop reason = instruction step into frame #0: 0x0000000103342b2c test.dylib
objc_msgSend
test.dylib`objc_msgSend:
→ 0x103342b2c <+0>: nop
0x103342b30 <+4>: ldr x16, #481568 ; (void *)0x000000019a9c9bc0: objc_msgSend
0x103342b34 <+8>: br x16
test.dylib`objc_msgSendSuper2:
0x103342b38 <+0>: nop
(lldb) p (char *) $x1
(char *) $0 = 0x000000018be36f0e “initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:”
(lldb) p (char *) $x2
(char *) $1 = 0x00000001371257b0 “\xffffffc1\xffffff9a\xffffffb7\xffffffa1\xffffffa1\x01”
(lldb)
问题:
使用命令:p (char *) $x1 的时候可以打印出来需要调用的方法签名
进一步想看看Title或message的时候,使用p (char *) $x2和p (char *) $x3的打印结果好像不太对,应该怎么打印呢?(备注,title和message均为中文)