zoukankan      html  css  js  c++  java
  • gdb 使用技巧

    实验平台: linux + gcc + gdb


    调试正在运行的进程。

    多次 fork(),exec()的程序,从头开始跟踪非常麻烦。可以使程序停在我们感兴趣的地方,然后用 gdb 去  attach。

            printf( "___I am waiting for being attached by gdb. my pid :_%d_________%s_%d__\n",  getpid(),  __FILE__ ,  __LINE__ );
            pause();
    Reading symbols from /lib/libnss_files.so.2done.
    Loaded symbols 
    for /lib/libnss_files.so.2
    0x00a047a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
    (gdb) b Main.cpp:
    1220
    Breakpoint 
    1 at 0x8054e85: file Main.cpp, line 1220.
    (gdb) signal 0
    Continuing with signal 0.
    [Switching to Thread 
    -1207969568 (LWP 24761)]

    Breakpoint 
    1, CAAA_App::SendSubProc (sock_handle=6) at Main.cpp:1220
    1220            printf( "_____被信号唤醒了\n" );
    (gdb)
  • 相关阅读:
    Go基础
    格式化输入输出
    常量
    Go语言基础之变量
    跨平台编译
    Hello World
    使用go module导入本地包
    Go语言之依赖管理
    Go包管理
    Go项目结构
  • 原文地址:https://www.cnblogs.com/diylab/p/1432631.html
Copyright © 2011-2022 走看看