Erdinç Taşkın
Erdinç Taşkın

Reputation: 1578

kill -3 for C++ application on solaris

I have an application written with C++ and running on Solaris. The application does lots of things and sends a heartbeat to a watchdog application for saying "I am alive". If something goes wrong the application does nothing (also does not send heartbeat). In a Java app, kill -3 helps me to see what is going on. Should I implement a similar functionality MANUALLY using signals for a native (non-java) app? Or is there any alternative way to see what is going on my application internally (thread state etc).

Upvotes: 0

Views: 243

Answers (2)

Nemo
Nemo

Reputation: 71595

Both Solaris and Linux support the gcore command to create a core dump of a running process. Then you can use gdb (or dbx) to analyze the core file.

Upvotes: 1

sth
sth

Reputation: 229824

The most flexible way to see what is going on in your native application is to attach a debugger and then examine whatever interests you manually.

If you terminate the application with kill -3 it will generate a core dump, which can later be manually examined with a debugger in a similar way.

If you want specific information logged/... in reaction to the signal sent by kill -3 you have to implement that yourself.

Upvotes: 0

Related Questions