Home > Back-end >  Create file which contain details about last crash point of application [closed]
Create file which contain details about last crash point of application [closed]

Time:09-22

I am working on one application which can not debug. so when i run that application at that time i want to maintain one file which contain information about from where application crashed.

i have developed this application in c and c .

So please help me How to create this type of file ?

i want idea how to store last crash details in file.

My application run on Verix OS.

CodePudding user response:

If you cannot modify the application ("can not debug") then your only source of data is whatever the application currently logs. Otherwise you need to reply on features of your operating system. On linux, for instance, a crashed process will generate a core file unless it's disabled via ulimit -c0. The other tool of interest would be tracing of the kernel, so you can capture at run-time. Again, on Linux, you want to look at eBPF. You may also want to look a resource utilization (memory, network, disk etc).

CodePudding user response:

Programming languages describe how the program behaves when it runs. When the program crashes, there's nothing that you can do in in the language, because the program is no longer running. As such, creation of such file is entirely external to the programming language itself.

The file that you describe is typically called a memory dump, core dump or similar name. Each computer system has their own dump format, and their own configuration for their creation. So, the first step is to know the system where your program is going to be run.

  • Related