[英]“svc #128” breaking in to debugger unexpectedly - how to debug?
There are a series of StackOverflow questions that mention unexpectedly breaking in to the debugger after a svc #128
instruction. 有一系列StackOverflow问题,提到在
svc #128
指令后意外插入调试器。 In dealing with this issue myself, I'd like to ask some general questions about when and why this occurs. 我本人在处理此问题时,想问一些有关何时以及为什么发生这种情况的一般性问题。
svc #128
is used for in iOS? svc #128
是什么? The svc #128
or svc 0x80
call is the Supervisor Call
within the ARM instruction set ( ARM Documentation ). svc #128
或svc 0x80
调用是ARM指令集中的“ Supervisor Call
”(《 ARM文档》 )。 You need to look at the register value to indicate what's being called. 您需要查看寄存器值以指示正在调用的内容。
Example assembler: 汇编程序示例:
libsystem_kernel.dylib`__pthread_kill:
0x195557268: movz x16, #328 // NOTE THIS VALUE
0x19555726c: svc #128
0x195557270: b.cc 0x195557288 ; __pthread_kill + 32
...
Lookup the movz
value (in this case #328
) in this table of Kernel System Calls . 在“ 内核系统调用”表中查找
movz
值(在这种情况下为#328
)。 For #328
, this corresponds to pthread_kill
, which matches the name of the method listed above. 对于
#328
,它对应于pthread_kill
,它与上面列出的方法名称匹配。 When the interrupt is called, it will land on the instruction immediately after svc
, in this example the b.cc
instruction. 调用该中断时,该中断将紧接
svc
之后的指令,在本例中为b.cc
指令。
Note that LLDB also breaks for certain thread to thread signals, eg SIGUSR2, even if it's intentional and correct. 注意,LLDB也会中断某些线程到线程的信号,例如SIGUSR2,即使它是有意且正确的。 You can configure Xcode to ignore this and continue execution without an issue:
您可以配置Xcode忽略它并继续执行而不会出现问题:
Permanently configuring LLDB (in Xcode 4.3.2) not to stop on signals 永久配置LLDB(在Xcode 4.3.2中)不停止信号
Thanks to Notlikethat for their input 感谢Notlikethat的投入
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.