An error occurred while loading the core file in gdb.

Source: Internet
Author: User

System settings

If you want the system to generate a core file when an error occurs due to signal interruption, you need to set it in shell as follows:
# Set the core size to unlimited
Ulimit-c unlimited
# Set the file size to unlimited
Ulimit unlimited

Modify the. bashrc file of the current user and add ulimit-c unlimited

Debug with GDB + CORE:

After a core dump occurs, use gdb to view the content of the core file to locate the line that causes the core dump in the file.
Gdb [exec file] [core file]
For example:
Gdb./test. core
You can use where or bt (breaktrace) to view the location and stack of an error.

In gdb debugging, you can also use the following commands to assist in debugging:

Search fun_name lookup Function

B fun_name sets a breakpoint in this function

B file. c 114 sets a breakpoint in row 114 of file. c.

Info break or info B to view the current breakpoint settings

Run the program

File: loads binary files.

N. Execute the next statement.

S one-step execution

C. Continue running

P name print variable

Q exit

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.