zoukankan      html  css  js  c++  java
  • 使用gdb+core查看错误信息

    core的使用Linux下core文件调试方法 

    ulimit -c xxx可以设置core文件的大小

    proc/sys/kernel/core_pattern可以控制core文件保存位置和文件名格式。
      可通过以下命令修改此文件:
      echo "/mnt/core-%e-%p-%t" > /proc/sys/kernel/core_pattern,可以将core文件统一生成到/corefile目录下,产生的文件名为core-命令名-pid-时间戳
      以下是参数列表:
          %p - insert pid into filename 添加pid
          %u - insert current uid into filename 添加当前uid
          %g - insert current gid into filename 添加当前gid
          %s - insert signal that caused the coredump into the filename 添加导致产生core的信号
          %t - insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间
          %h - insert hostname where the coredump happened into filename 添加主机名
          %e - insert coredumping executable name into filename 添加命令名

    使用gdb查看core。如果是交叉编译器的可执行文件不能使用当前系统下的gdb。

      在~目录下配置.gdbinit文件。

      set solib-absolute-prefix YOUR_CROSS_COMPILE_PATH

      set solib-search-path YOUR_CROSS_COMPILE_PATH
      set solib-search-path YOUR_DEVELOPER_TOOLS_LIB_PATH
      handle SIG32 nostop noprint pass

    我以上三个路径前两个为交叉编译的路径,后一个将目标板的lib复制出来使用。

    最后使用gdb 待调试可执行文件 core文件就能进行调试

    少壮不识cpp,老大方知cpp可怕
  • 相关阅读:
    使用 libevent 和 libev 提高网络应用性能
    An existing connection was forcibly closed by the remote host
    各种浏览器的兼容css
    vs输出窗口,显示build的时间
    sass
    网站设置404错误页
    List of content management systems
    css footer not displaying at the bottom of the page
    强制刷新css
    sp_executesql invalid object name
  • 原文地址:https://www.cnblogs.com/Jacket-K/p/7390612.html
Copyright © 2011-2022 走看看