Solaris上C++应用程序的3

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).

#0

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.

#1

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.

推荐文章

需要澄清闭包中的循环问题

需要澄清闭包中的循环问题

推荐文章

打印次数x基于单元格值的次数

打印次数x基于单元格值的次数

推荐文章

保存旋转位图android

保存旋转位图android

推荐文章

如何对其进行单元测试(使用mock或经典的单元测试?)

如何对其进行单元测试(使用mock或经典的单元测试?)

推荐文章

“场”作用域不支持“Module”类型的元素。无法安装此功能

“场”作用域不支持“Module”类型的元素。无法安装此功能

推荐文章

有没有解决onemselectedlistener错误的方法?

有没有解决onemselectedlistener错误的方法?

推荐文章

从active directory获取计算机名

从active directory获取计算机名

推荐文章

在Windows Phone 7上防止在IE中滚动

在Windows Phone 7上防止在IE中滚动

推荐文章

使用jQuery模板使用ColdFusion json数据

使用jQuery模板使用ColdFusion json数据

推荐文章

在html表单提交中处理UTF字符

在html表单提交中处理UTF字符

推荐文章

plsql使用一个execute immediate命令插入多行

plsql使用一个execute immediate命令插入多行

推荐文章

NSINdexPath作为treeview索引

NSINdexPath作为treeview索引

推荐文章

如何处理PrincipalPermission安全异常

如何处理PrincipalPermission安全异常

推荐文章

从MSBuild调用PowerShell会中断长行文本

从MSBuild调用PowerShell会中断长行文本

推荐文章

一次性警报?

一次性警报?

推荐文章

如何在Oracle中生成派生列并使用它?

如何在Oracle中生成派生列并使用它?