<legend id='TAUha'><style id='TAUha'><dir id='TAUha'><q id='TAUha'></q></dir></style></legend>

  • <tfoot id='TAUha'></tfoot>
    <i id='TAUha'><tr id='TAUha'><dt id='TAUha'><q id='TAUha'><span id='TAUha'><b id='TAUha'><form id='TAUha'><ins id='TAUha'></ins><ul id='TAUha'></ul><sub id='TAUha'></sub></form><legend id='TAUha'></legend><bdo id='TAUha'><pre id='TAUha'><center id='TAUha'></center></pre></bdo></b><th id='TAUha'></th></span></q></dt></tr></i><div id='TAUha'><tfoot id='TAUha'></tfoot><dl id='TAUha'><fieldset id='TAUha'></fieldset></dl></div>

    • <bdo id='TAUha'></bdo><ul id='TAUha'></ul>
    1. <small id='TAUha'></small><noframes id='TAUha'>

        我可以在 iOS 中的代码中创建一个断点,比如 VC++ 上的 `__asm{int 3}`,然后在它被命中后继续执行吗

        时间:2023-06-11
          <tbody id='NPJs9'></tbody>

        <i id='NPJs9'><tr id='NPJs9'><dt id='NPJs9'><q id='NPJs9'><span id='NPJs9'><b id='NPJs9'><form id='NPJs9'><ins id='NPJs9'></ins><ul id='NPJs9'></ul><sub id='NPJs9'></sub></form><legend id='NPJs9'></legend><bdo id='NPJs9'><pre id='NPJs9'><center id='NPJs9'></center></pre></bdo></b><th id='NPJs9'></th></span></q></dt></tr></i><div id='NPJs9'><tfoot id='NPJs9'></tfoot><dl id='NPJs9'><fieldset id='NPJs9'></fieldset></dl></div>

          <small id='NPJs9'></small><noframes id='NPJs9'>

              <bdo id='NPJs9'></bdo><ul id='NPJs9'></ul>
              <legend id='NPJs9'><style id='NPJs9'><dir id='NPJs9'><q id='NPJs9'></q></dir></style></legend>
              • <tfoot id='NPJs9'></tfoot>

                  本文介绍了我可以在 iOS 中的代码中创建一个断点,比如 VC++ 上的 `__asm{int 3}`,然后在它被命中后继续执行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试将等效的 asm{int 3} (或类似的)放入我的 iPhone 程序中.我的目标是让 Xcode 准确地停在有问题的行上,而不必摆弄调用堆栈(所以 _Debugger 听起来不像它会做的那样,并不是说我无论如何都能找到它所在的框架...),让我能够继续执行(这就是我对 assert 不满意的原因).

                  I'm trying to put the equivalent of asm{int 3} (or similar) into my iPhone program. My goal is to have Xcode stop exactly on the offending line, without having to fiddle with the call stack (so _Debugger doesn't sound like it would do, not that I could find which framework it's in anyway...), and leave me able to resume execution (which is why I'm not happy with assert).

                  (我在其他系统上已经习惯了这两种行为,我想在 iOS 上重现它们.)

                  (I'm used to both these behaviours on other systems, and I'd like to reproduce them on iOS.)

                  到目前为止我最好的尝试是这样的:

                  My best attempt so far has been this:

                  asm volatile("bkpt 1");
                  

                  这会在有问题的行上停止 Xcode,但是当我尝试继续使用 Cmd+Alt+P 时,Xcode 似乎再次运行 BKPT.如果我使用 Shift+Cmd+O,我会得到这个:

                  This stops Xcode on the line in question, but when I try to continue with Cmd+Alt+P, Xcode appears to run the BKPT again. And if I use Shift+Cmd+O, I just get this:

                  Watchdog has expired.  Remote device was disconnected?  Debugging session terminated.
                  

                  (不用说,远程设备仍然连接.)

                  (Needless to say, the remote device IS still connected.)

                  我在 iOS、Mac、ARM、gdb 或 gcc 的 asm 方面没有大量经验.所以我已经难住了.有什么方法可以让 iOS 和 Xcode 做我想做的事吗?

                  I don't have a huge amount of experience with iOS, Mac, ARM, gdb, or gcc's asm stuff. So I'm stumped already. Is there some way of getting iOS and Xcode to do what I want?

                  (我不知道这是否有区别,但从指令大小来看,我的程序是 ARM 代码.)

                  (I don't know if it makes a difference but judging by the instruction size my program is ARM code.)

                  推荐答案

                  raise(SIGTRAP) 是一种相对可移植的方式来设置in code"断点.

                  raise(SIGTRAP) is a relatively portable way to have an "in code" breakpoint.

                  这篇关于我可以在 iOS 中的代码中创建一个断点,比如 VC++ 上的 `__asm{int 3}`,然后在它被命中后继续执行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:ARM、MIPS、x86 的 Android os.arch 输出? 下一篇:混合 ARM 和 THUMB 指令

                  相关文章

                    <tfoot id='3gmiH'></tfoot>
                    • <bdo id='3gmiH'></bdo><ul id='3gmiH'></ul>
                    <legend id='3gmiH'><style id='3gmiH'><dir id='3gmiH'><q id='3gmiH'></q></dir></style></legend>
                  1. <small id='3gmiH'></small><noframes id='3gmiH'>

                    <i id='3gmiH'><tr id='3gmiH'><dt id='3gmiH'><q id='3gmiH'><span id='3gmiH'><b id='3gmiH'><form id='3gmiH'><ins id='3gmiH'></ins><ul id='3gmiH'></ul><sub id='3gmiH'></sub></form><legend id='3gmiH'></legend><bdo id='3gmiH'><pre id='3gmiH'><center id='3gmiH'></center></pre></bdo></b><th id='3gmiH'></th></span></q></dt></tr></i><div id='3gmiH'><tfoot id='3gmiH'></tfoot><dl id='3gmiH'><fieldset id='3gmiH'></fieldset></dl></div>