`

linux debug调试工具

阅读更多

转自:http://www.cnblogs.com/zhenjing/archive/2010/10/27/1862458.html

1. gdb attach [pid] -- debug a running process

2. valgrind-- a suite of tools for debugging and profiling programs

Very powerful tool to debug linux program,just for x86 platform

3. strace -trace system calls and signals

In the simplest case strace runs thespecified command until it exits.  It intercepts  and records  the system calls which are called by a process and the signalswhich are received by a process.  The name of each system call, itsarguments and its return value are printed on standard error or to the file specifiedwith the -o option.

4. pstack -print a stack trace of a running process

It's often used to check the stack of hungprocess.

5. mtrace, muntrace - malloc debugging

The  function  mtrace() installs  handlers for malloc(), realloc() and free().  The functionmuntrace() disables these handlers.
The environment variable MALLOC_TRACE defines a file where mtrace() writes itsoutput.  This  file  must be writable to the user or mtrace()will do nothing.  If the file is not empty it will be truncated.

Usage: call the two function before andafter the code you want to pay attention on.

6. dmesg -print or control the kernel ring buffer

Check the error message of all kind ofprogram, especail for third-party program.

7. binutils-- a tools set

* ld - the GNU linker.

* as - the GNU assembler.

* addr2line - Converts addresses intofilenames and line numbers.

* ar - A utility for creating, modifyingand extracting from archives.

* c+filt - Filter to demangle encoded C+symbols.

* gprof - Displays profiling information.

* nlmconv - Converts object code into anNLM.

* nm - Lists symbols from object files.

* objcopy - Copys and translates objectfiles.

* objdump - Displays information fromobject files.

* ranlib - Generates an index to thecontents of an archive.

* readelf - Displays information from anyELF format object file.

* size - Lists the section sizes of anobject or archive file.

* strings - Lists printable strings fromfiles.

* strip - Discards symbols.

* windres - A compiler for Windows resourcefiles.

8. ldd -print shared library dependencies

9. ld.so, ld-linux.so* - dynamic linker/loader

---------------------------------------------------

10.lsof -list open files

Very useful to check if fd leak.

11. netstat  -  Print network connections, routing tables, interfacestatistics, masquerade connections, and multicast memberships

12. iostat  -  Report  Central  Processing Unit (CPU) statisticsand input/output statistics for devices and partitions.

13. vmstat -Report virtual memory statistics

14. time - time a simple command or give resource usage. System time depend on system status, User time is the real time of your program used.

分享到:
评论

相关推荐

    Linux 内核调试环境

    GDB是Linux下最常用的调试工具,它可以让我们在运行时检查代码,设置断点,查看内存状态和调用堆栈。 "readme.txt"通常包含有关项目的重要信息,如安装指南、注意事项或特定的调试技巧。对于Linux内核调试,它可能...

    Debug+Hacks中文版+深入调试的技术和工具 完整.rar

    总而言之,《Debug+Hacks中文版:深入调试的技术和工具》是一本全面而深入的教程,它不仅提供了丰富的调试工具知识,还涵盖了调试思维和实践策略,对于提升Linux开发者的技能水平有着极大的帮助。通过阅读这本书,你...

    Linux下debug的工具inteltool

    总的来说,`inteltool`是Linux环境下对Intel BIOS进行调试和分析的强大工具,对于coreboot的开发者以及希望深入了解和调整BIOS的IT专业人士来说,它是不可或缺的。然而,由于涉及到系统的底层操作,务必谨慎使用,并...

    linux下的程序调试工具ltrace和strace终版.pdf

    Linux下的程序调试工具ltrace和strace终版 在 Linux 操作系统中,程序调试是非常重要的一步,对于程序的开发、测试和优化都起着至关重要的作用。在 Linux 中,有两种常用的程序调试工具:ltrace 和 strace。这两种...

    动态分等级打印.Linux 程序开发打印 Debug 信息的使用技巧--C语言中几种输出调试信息的方法_精品文库_IThao12

    通过宏定义、标准库函数和系统调用的组合,可以创建一套灵活且强大的调试工具集。在生产环境中,应当谨慎控制Debug信息的输出,避免对性能造成过多影响。同时,良好的日志管理习惯也有助于长期维护和排查问题。

    Linux下debug的工具superiotool

    `superiotool`是一款专为Linux设计的工具,用于检测和调试所谓的"Super I/O"(Super Input/Output)芯片。这些芯片广泛应用于各种硬件设备,包括计算机主板,以提供串口、并口、键盘、鼠标等I/O接口的控制。在BIOS...

    正则表达式调试工具

    正则表达式调试工具是开发人员用来测试和优化这些模式的重要辅助工具。本文将详细介绍"正则表达式调试工具V3.0 绿色免费版"的特点及其在软件开发中的应用。 该调试工具界面简洁,旨在为开发者提供一个友好的环境来...

    Debug Hacks中文版 深入调试的技术和工具

    Debug+Hacks中文版—深入调试的技术和工具,主要讲述linux下的常见调试方法,还是挺不错,希望对你有帮助。

    Linux内核调试工具Kprobe机制的研究.pdf

    Linux 内核调试工具 Kprobe 机制的研究 本文主要介绍了 Linux 内核调试工具 Kprobe 机制的研究,包括 Kprobe 机制简介、Kprobe 机制...Kprobe 机制是一种非常有用的调试工具,能够帮助开发者轻松地 debug 内核代码。

    i2c调试工具支持android、Linux

    i2c调试工具是针对嵌入式系统,尤其是基于Android和Linux操作系统的设备设计的,主要用于检测和调试I2C(Inter-Integrated Circuit)总线上的设备。在这些系统中,I2C总线被广泛用于连接微控制器、传感器、显示模块...

    驱动程序 内核调试常用工具

    总结来说,DebugPrint、DebugView、DevView 和 WDMBuild 是驱动程序内核调试的关键工具,它们分别提供了输出调试信息、实时查看调试数据、设备管理和驱动构建的功能。了解并熟练使用这些工具,对于开发和调试高质量...

    64位debug安装工具 64位系统汇编工具 DosBox集合包

    在IT领域,尤其是在系统开发和低级编程中,掌握汇编语言和调试工具是至关重要的。这个"64位debug安装工具 64位系统汇编工具 DosBox集合包"显然是为那些对底层操作和系统级编程感兴趣的人员设计的。让我们深入探讨...

    Debug.Hacks中文版扫描版_深入调试的技术和工具

    《Debug.Hacks中文版扫描版_深入调试的技术和工具》这本书是针对IT专业人士,特别是软件开发者和系统管理员的一本深入探讨调试技术与工具的指南。它涵盖了从基础到高级的各种调试场景,旨在帮助读者提高在Linux环境...

    linux_wifi debug

    4. 调试工具:使用如dmesg、sysfs、netlink等工具监控驱动运行状态,捕捉错误信息。 5. 连接测试:尝试连接到不同的WiFi网络,观察连接速度、稳定性等性能指标。 6. 错误分析:当遇到连接问题或性能问题时,查看...

    arm-linux详细的串口调试(适合初学者)

    串口调试是嵌入式开发中的一个重要环节,特别是在ARM-Linux系统中,它为开发者提供了一种直观、有效的通信方式。本文将详细讲解如何在ARM-Linux上进行串口调试,这对于初学者来说是一次非常实用的学习经历。 首先,...

    eclipse linux 远程调试

    标题“Eclipse Linux 远程调试”涉及到的是在Linux环境下使用Eclipse集成开发环境(IDE)进行远程Java应用的调试技术。Eclipse是一款强大的开源IDE,广泛用于Java开发,同时也支持其他编程语言。Linux作为开源操作系统...

    window linux debug 技巧

    Windbg,全称Windows Debugger,是由微软提供的一个强大的调试工具,适用于调试用户模式和内核模式的应用程序。它包含丰富的命令集,能够帮助开发者进行崩溃分析、内存泄漏检测、性能优化等任务。 - 常用命令: ...

    codelldb-x86-64-linux.vsix 下载,用于vscode 的LLDB 插件,用来debug调试 vscode

    总之,`codelldb-x86_64-linux.vsix`插件是VSCode在Linux上进行C++、Go、Rust等语言调试的重要工具,它充分利用了LLDB的强大功能,提供了高效、直观的调试体验。通过正确安装和配置,开发者可以提升其代码调试效率,...

    一个可以用gdb调试linux内核的环境

    自己搭建的一个可以用gdb调试linux内核的环境,解压后看README,其中有详细的搭建过程。 简单来说就是在一台linux主机上用bochs虚拟机调试内核。 用到的工具: 一台linux主机 bochs源码,压缩包中已有 busybox源码,...

    汇编环境完整包[dosbox安装包+汇编链接debug全套工具]

    这个环境主要包括两个核心部分:DOSBox模拟器和汇编语言的编译、链接及调试工具。 DOSBox是一个开源的DOS模拟器,它可以在不支持DOS操作系统的现代计算机上运行。DOSBox0.74-win32-installer.exe是DOSBox的安装程序...

Global site tag (gtag.js) - Google Analytics