View core dumps

I am writing a small program. When I run one of the parameters, I get the following error.

terminate called after throwing an instance of 'std::invalid_argument' what(): stoi Aborted (core dumped) 

I look in the directory where I store the .cpp and .h files, and the kernel appears there after starting. I used

 ulimit -c unlimited 

And I checked it with

 unlimit -a. 

When I run gdb in my terminal and try to access the kernel, I get the following response

 not in executable format: File format not recognized 

How would I look at my main dump so that I can see what causes it?

+5
source share
1 answer

To parse a basic dump with GDB, pass it as the second argument to GDB after the executable:

 gdb executable core 

GDB will load the state of the executable file at the time of its reset. You can examine its memory (including the back trace of the stack, as well as any data on the heap or the stack), but you will not be able to perform actions that require the execution of an executable file (for example, the function of a step, continue, or call).

+6
source

Source: https://habr.com/ru/post/1206370/


All Articles