我看到了 gdb 在核心转储后转储所有线程的回溯的这一漂亮的衬线。所以我尝试了一个快速:
int main() {int* x = new int[5]; for(int i = 0; true; ++i) x[i] = i; }
获取核心转储,然后运行:
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" a.out core.box-name.a.out.27459.8515.11
我得到输出:
[New LWP 27459]
warning: Can't read pathname for load map: Input/output error.
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff9e503000
Core was generated by `./a.out'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000000004005ca in main () at <stdin>:6
6 <stdin>: No such file or directory.
Thread 1 (LWP 27459):
#0 0x00000000004005ca in main () at <stdin>:6
i = 33788
x = 0x1a460010
我看到一个很好的回溯,但我想知道我还看到的两个警告是关于什么的?