How to use Strace debugging tools

Source: Internet
Author: User
This article describes how to use the Strace debugging tool in detail. For more information, see StraceYes LinuxA program debugging tool in the environment to monitor the system calls used by an application and the system information it receives.
Strace is a useful tool that lets you know what a program is doing in the background by tracking system calls. Strace is a basic debugging tool installed by default on most Linux systems, but it is an excellent software even if you are not tracking a problem. It tells you a lot about how a Linux program works.

Let's start with a simple UNIX command pwd, and then study in depth what the command does when it completes its task. Start xterm to create a controlled environment for the experiment, and then enter the following command:

$ Pwd

The pwd command displays the current working directory. On my computer, the output at the time was:

/Home/bill/

Such a simple function masks the complexity of the underlying layer of the command (by the way, all computer programs are like this ). To truly understand its complexity, run the pwd command again using strace:

$ Strace pwd

With this command, you can see that many operations are performed on UNIX computers during the process of displaying and listing the current working directory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.