A small exploration of the address of analytic function with Addr2line

Source: Internet
Author: User
Tags dmesg


Recently know the exact line that uses DMESG and addr2line to locate a segment error. So he did a small experiment, in the experiment found that this method is sometimes not brilliant, depending on the type of paragraph errors.

I wrote the applet:

After compiling a segment error, the DMESG command is used to locate the wrong address, and then use Addr2line to locate the row number, and find that the location failed. It seems that this kind of error is not feasible in this way.


Here's what you find on the Web:

The Addr2line tool (which is part of the standard GNU Binutils) is a tool that converts the address and executable image of a directive into a file name, function name, and number of source code lines.

D MESG command:

syntax:dMESG [-cn][-s < buffer size;]

Additional Note:the kernel will store the boot information in ring buffer. If you are too late to view the information, you can use DMESG to view it. The boot information is also stored in the/var/log directory, in the file named DMESG.

Parameters
-C Clears the contents of the ring buffer after displaying the information.
-s< buffer size > pre-set to 8196, just equal to the size of the ring buffer.
-N Sets the level of logging information.

DMESG Command main purpose


Main applications:

DMESG is used to display the kernel ring buffer (kernel-ring buffer) content, and the kernel stores various messages here. At system boot time, the kernel fills in this buffer with information related to hardware and module initialization. Messages in the kernel ring buffer are often useful for diagnosing system problems. When you run DMESG, it displays a lot of information. It is common to use the pipe to view the output of DMESG through less or grep , which makes it easier to find unknown origin information. For example, if you find that your hard disk is performing poorly, you can use DMESG to check that they are running in DMA mode:

$DMESG | grep DMA



A small exploration of the address of analytic function with Addr2line

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.