代码之家  ›  专栏  ›  技术社区  ›  Salahuddin

GDB输出不可读

  •  0
  • Salahuddin  · 技术社区  · 6 年前

    Linux (Debian) 机器和使用 QT Creator . 我尝试使用以下方法进行调试 GDB 命令:

    thread apply all bt

    158thread apply all bt
    >&"thread apply all bt\n"
    >~"\nThread 4 (LWP 6801):\n"
    >~"#0  0x00007ffff6da6994 in ?? ()\n"
    >~"#1  0x0008800002d0da5d in ?? ()\n"
    >~"#2  0x0000000000000002 in ?? ()\n"
    >~"#3  0x00007d640002dfe3 in ?? ()\n"
    >~"#4  0x00007ffff3395ac0 in ?? ()\n"
    >~"#5  0x00007ffff6d539dd in ?? ()\n"
    >~"#6  0x00007d2000000400 in ?? ()\n"
    >~"#7  0x0000000000000078 in ?? ()\n"
    >~"#8  0x00007ffff6d8f9b6 in ?? ()\n"
    >~"#9  0x0000000000000078 in ?? ()\n"
    >~"#10 0x0000000000000010 in ?? ()\n"
    >~"#11 0x00007ffff3395ac0 in ?? ()\n"
    >~"#12 0x0000000000000001 in ?? ()\n"
    >~"#13 0x00007ffff6d539dd in ?? ()\n"
    >~"#14 0x00007ffff6d9028c in ?? ()\n"
    >~"#15 0x0000000000000004 in ?? ()\n"
    >~"#16 0x00007d2000000400 in ?? ()\n"
    >~"#17 0x00007ffff3394b10 in ?? ()\n"
    >~"#18 0x00007fff00000000 in ?? ()\n"
    >~"#19 0x00007d940000ca38 in ?? ()\n"
    >~"#20 0x00007ffff3395ac0 in ?? ()\n"
    >~"#21 0x0000000000000078 in ?? ()\n"
    >~"#22 0x0000000000000000 in ?? ()\n"
    >~"\nThread 3 (LWP 6800):\n"
    >~"#0  0x00007ffff5c518bd in ?? ()\n"
    >~"#1  0x0000000000000001 in ?? ()\n"
    >~"#2  0x00007ffff6d6e919 in ?? ()\n"
    >~"#3  0x00000064f3b96040 in ?? ()\n"
    >~"#4  0x00007ffff3b96a01 in ?? ()\n"
    >~"#5  0x00007ffff3b96ac0 in ?? ()\n"
    >~"#6  0x000000000048e149 in pTimerThread (pData=<error reading variable: Cannot access memory at address 0xfffffffffff97328>) at /mnt/hgfs/Projects/deom/Modul/osTimer.c:267\n"
    >~"Backtrace stopped: Cannot access memory at address 0xfffffffffff973c8\n"
    >~"\nThread 2 (LWP 6799):\n"
    >~"#0  0x00007ffff5c2a28d in ?? ()\n"
    >~"#1  0x0000000000000000 in ?? ()\n"
    >~"\nThread 1 (LWP 6795):\n"
    >~"#0  0x00007ffff67bd556 in ?? ()\n"
    >~"#1  0x00007ffff3c03808 in ?? ()\n"
    >~"#2  0x00007ffff7f64880 in ?? ()\n"
    >~"#3  0x00007d140000ef80 in ?? ()\n"
    >~"#4  0xfffffffeffffffff in ?? ()\n"
    >~"#5  0x00007fffffffded0 in ?? ()\n"
    >~"#6  0x00007ffff67bd604 in ?? ()\n"
    >~"#7  0x00007ffff7f64880 in ?? ()\n"
    >~"#8  0x0000000000000000 in ?? ()\n"
    >158^done
    

    我唯一能读懂的一句话是:

    >~"#6 0x000000000048e149 in pTimerThread (pData=<error reading variable: Cannot access memory at address 0xfffffffffff97328>) at /mnt/hgfs/Projects/deom/Modul/osTimer.c:267\n"

    这个命令不应该给出每个线程最近调用的函数的列表吗?为什么它只给出地址列表而不直接给出函数名?有没有办法知道这些地址中定义了哪些函数?

    0 回复  |  直到 6 年前
        1
  •  0
  •   TainToTain    6 年前

    可执行文件没有调试符号。假设还没有去掉符号,用 -g (假设您使用的是gcc/clang)。