lldb动态调试的问题

小弟想看一个变量被谁调用了,于是按照大大的书上内容+lldb进行调试

启动进程

debugserver -x backboard *:1234 /User/Applications/E263D7BA-9A41-454B-A939-667F3A6A5E88/QQ.app/QQ
debugserver-310.2 for arm64.
Listening to port 1234 for a connection from *...
Got a connection, launched process debugserver.

然后lldb连接后提示

process connect connect://192.168.1.106:1234
Process 1509 stopped
* thread #1: tid = 0x1ceb7, 0x2be30028 dyld`_dyld_start, stop reason = signal SIGSTOP
    frame #0: 0x2be30028 dyld`_dyld_start
dyld`_dyld_start:
-> 0x2be30028:  mov    r8, sp
   0x2be3002c:  sub    sp, sp, #0x10
   0x2be30030:  bic    sp, sp, #0x7
   0x2be30034:  ldr    r3, [pc, #112]            ; _dyld_start + 132
(lldb) c
Process 1509 resuming
(lldb) error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 33
error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 33
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 33
error: unable to find section for section 34
error: unable to find section for section 34
error: no modules found that match 'list'

APP启动后就始终处于黑屏状态
然后过段时间就重新启动了。
问题出在哪里?

如果是进程附加 就出现这个问题:

debugserver *:1234 --attach 428
debugserver-310.2 for arm64.
Attaching to process 428...
Segmentation fault: 11

以为是debugserver的问题,所以换成8.1版本的debugserver 错误依旧

这个问题解决了,我换成iPhone6后,就没有这个问题了。

但是还是这个问题

(lldb) process connect connect://192.168.1.107:1234
error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 33
error: unable to find section for section 34
error: unable to find section for section 34
error: unable to find section for section 33
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 32
error: unable to find section for section 33
error: unable to find section for section 34
error: unable to find section for section 34

调试其他的App有这个问题吗?

没有,发现不影响调试,结贴

老大 这个是怎么回事?

我在一个变量断下,想看下是谁调用的,然后跳转到了另一个dylib,要怎么去跟?

* thread #1: tid = 0x58ef, 0x011e291a QQ`___lldb_unnamed_function21$QQ + 716172, queue = 'com.tencent.wtlogin_run_queue', stop reason = breakpoint 1.1
    frame #0: 0x011e291a QQ`___lldb_unnamed_function21$QQ + 716172
QQ`___lldb_unnamed_function21$QQ + 716172:
-> 0x11e291a:  bx     lr
   0x11e291c:  movw   r1, #0xca20
   0x11e2920:  movt   r1, #0x145
   0x11e2924:  add    r1, pc
(lldb) ni
Process 885 stopped
* thread #1: tid = 0x58ef, 0x3860bf46 libobjc.A.dylib`objc_msgSend + 6, queue = 'com.tencent.wtlogin_run_queue', stop reason = EXC_BAD_ACCESS (code=1, address=0xe88d3023)
    frame #0: 0x3860bf46 libobjc.A.dylib`objc_msgSend + 6
libobjc.A.dylib`objc_msgSend + 6:
-> 0x3860bf46:  ldrh.w r12, [r9, #12]
   0x3860bf4a:  ldr.w  r9, [r9, #8]
   0x3860bf4e:  and.w  r12, r12, r1
   0x3860bf52:  add.w  r9, r9, r12, lsl #3

不是跳到了另一个dylib,貌似是直接崩掉了,

我使用lldb调试的时候也经常会EXC_BAD_ACCESS

Segmentation fault: 11 不是代表有反调试吗