zoukankan      html  css  js  c++  java
  • 常用GDB命令行调试命令

    po

    po是print-object的简写,可用来打印所有NSObject对象。使用举例如下:

    (gdb) po self

    <LauncherViewController: 0x552c570>

    (gdb) po [self view]

    <UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>

    (gdb) print-object [self view]

    <UIView: 0x544eb80; frame = (0 0; 320 411); autoresize = W+H; layer = <CALayer: 0x544ebb0>>

    p

    p是print的简写,可以用来打印所有的简单类型,如int, float,结构体等。使用举例如下:

    (gdb) p self

    $1 = (LauncherViewController *) 0x552c570

    (gdb) p [[self view] size]

    Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.

    To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)

    (gdb) p (CGSize)[[self view] size]

    $1 = {

    width = 320,

    height = 411

    }

    (gdb) print (CGSize)[[self view] size]

    $2 = {

    width = 320,

    height = 411

    }

    call

    call即是调用的意思。其实上述的po和p也有调用的功能。因此一般只在不需要显示输出,或是方法无返回值时使用call。使用举例如下:

    (gdb) call [[self view]sizeToFit]

    Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.

    To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)

    (gdb) call (void)[[self view]sizeToFit]

    (gdb) call [[self view] size]

    Unable to call function “objc_msgSend” at 0x1e7e08c: no return type information available.

    To call this function anyway, you can cast the return type explicitly (e.g. ‘print (float) fabs (3.0)’)

    (gdb) call (void)[[self view] size]

     

  • 相关阅读:
    vector
    codeforces 1453D. Checkpoints
    [ICPC2019 WF]Hobson's Trains
    [ICPC2019 WF]Circular DNA
    计算几何板子
    CSP-S2020 贪吃蛇(洛谷民间数据)
    CSP-S2020 函数调用(洛谷民间数据)
    [NOI Online #3 提高组]魔法值
    [NOI Online #1 提高组]冒泡排序
    佳能m62套机5500 佳能EOS M50 M6 MARK2 II二代 最低到过5800
  • 原文地址:https://www.cnblogs.com/weilaikeji/p/3329270.html
Copyright © 2011-2022 走看看