文档章节

Linux Debug tools all

romalin99
 romalin99
发布于 2014/09/24 14:19
字数 394
阅读 26
收藏 0

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.


© 著作权归作者所有

romalin99
粉丝 8
博文 153
码字总数 76769
作品 0
浦东
高级程序员
私信 提问
DS-5笔记(Gnometris)

If you are working on an EB-A8 RTSM model the debugger automatically boots ARM Linux if required. Examples(DS-5自带的例子:非操作系统和Linux平台下的例子) DS-5 provides a sele......

长平狐
2013/06/03
151
0
GNU编译工具

Development Studio 5 includes a distribution of the GNU Compiler Collection (GCC) and related GNU utilities. This distribution is referred to in this document as the 'GNU Compil......

长平狐
2013/06/03
213
0
在Ubuntu12.10-32bit上构建、测试WebRTC之Android示例WebRTCDemo

参考资料: http://www.webrtc.org/reference/getting-started http://www.webrtc.org/reference/getting-started/prerequisite-sw http://code.google.com/p/webrtc/issues/detail?id=1435 ......

今幕明
2015/01/18
2.2K
0
DS-5 的示例项目

The example projects provided with DS-5 illustrate how to use the DS-5 toolchain to create and debug a variety of project types: nCalendar is a simple bare metal application, us......

长平狐
2013/06/03
44
0
Android第三课 联调华为手机

1 现象 windows环境,通过adb devices命令查看到华为手机的设备如下: List of devices attached ???????????? device Linux环境下出现的问题: 运行sudo ./adb devices 时,若有如下输出: ...

fengyuzaitu
2018/08/07
0
0

没有更多内容

加载失败,请刷新页面

加载更多

mysql-connector-java升级到8.0后保存时间到数据库出现了时差

在一个新项目中用到了新版的mysql jdbc 驱动 <dependency>     <groupId>mysql</groupId>     <artifactId>mysql-connector-java</artifactId>     <version>8.0.18</version> ......

ValSong
32分钟前
4
0
Spring Boot 如何部署到 Linux 中的服务

打包完成后的 Spring Boot 程序如何部署到 Linux 上的服务? 你可以参考官方的有关部署 Spring Boot 为 Linux 服务的文档。 文档链接如下: https://docs.ossez.com/spring-boot-docs/docs/r...

honeymoose
34分钟前
5
0
Spring Boot 2 实战:使用 Spring Boot Admin 监控你的应用

1. 前言 生产上对 Web 应用 的监控是十分必要的。我们可以近乎实时来对应用的健康、性能等其他指标进行监控来及时应对一些突发情况。避免一些故障的发生。对于 Spring Boot 应用来说我们可以...

码农小胖哥
今天
6
0
ZetCode 教程翻译计划正式启动 | ApacheCN

原文:ZetCode 协议:CC BY-NC-SA 4.0 欢迎任何人参与和完善:一个人可以走的很快,但是一群人却可以走的更远。 ApacheCN 学习资源 贡献指南 本项目需要校对,欢迎大家提交 Pull Request。 ...

ApacheCN_飞龙
今天
4
0
CSS定位

CSS定位 relative相对定位 absolute绝对定位 fixed和sticky及zIndex relative相对定位 position特性:css position属性用于指定一个元素在文档中的定位方式。top、right、bottom、left属性则...

studywin
今天
7
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部