Gdb debugging does not generate a core file solution

  1. Use ulimit -a to check whether the core file size item is unlimited . If not, modify it to unlimited , which means that the size of the core file is not limited
ulimit -c unlimited
  1. If the core file still cannot be generated in the current folder, execute the following command.
    %e represents the ELF corresponding to the core,
    %p represents the process number when the ELF is running, and
    %t represents the start time of the operation.
sudo bash -c "echo core_%e_%p_%t > /proc/sys/kernel/core_pattern"

Guess you like

Origin blog.csdn.net/HuangChen666/article/details/131473621