Monday 15 July 2013

android - how to dump the call stack information for native(C/C++) process explicitly when it is not crashed in linux -


People:

As you know, in Linux / Android, when a process gets some SIG The process crash, such as page fault, segment fault, etc., then for these signals, the default behavior from the system will first dump the main information, including the call stack information, and then delete the process.

But sometime, although my program has not crashed, it is actually running abnormally already and I do not expect it, so I want to know that this code is still going on, so I want to dump the call stack manually to it. So how to do it? Send this Segment fault signal manually? or else ....?

Anyone can share the experience?

Thx a lot beforehand

Throw an exception and grab it immediately. I'm not quite familiar with C, but in Java it will look like this:

  Try {New Runtime Expansion ("Blaaba"); } Hold (Exception pre) {ex.printStackTrace (); }    

No comments:

Post a Comment