Generate core file with original process name

2019-05-18 21:43发布

问题:

I have a binary which will create multiple threads. Now when one of those threads crashes, I want the name of the core file generated to contain the original process name instead of the thread name.

When I use the %e specifier, it gives the thread name only (I think it is because in Linux, all threads are considered as LWPs).

How do I get the original process which created the thread in the core file name?

I looked at the man file, but it does not have any other specifier which I can use.