Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Application stack trace facility
@ 2002-03-19 20:13 Krishna Kondaka
  2002-03-20 13:01 ` Johannes Stezenbach
  0 siblings, 1 reply; 2+ messages in thread
From: Krishna Kondaka @ 2002-03-19 20:13 UTC (permalink / raw)
  To: linux-mips

Hi,
	I would like to know if there is a system call/library function 
	available in linux which prints the current stack trace of the 
	application.
	
	For ex., 
	If main() calls a() which calls b() which in turn calls c() and if
	c() is defined as
	
	c()
	{
		....
		if (condition)
			dump_stack_trac();
		....
	}
	
	the dump_stack_trace() should print if the "condition" is true -
	
	c(...)
	b(...)
	a(...)
	main(..)
	
	Is there such "dump_stack_trace" library function/system call available?
	I know that if I make the program dump core in the dump_stack_trace 
	function then I can get the stack trace from the core dump but I would
	like to know if I can do this without forcing the core dump.

TIA
Krishna Kondaka
Sanera Systems

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Application stack trace facility
  2002-03-19 20:13 Application stack trace facility Krishna Kondaka
@ 2002-03-20 13:01 ` Johannes Stezenbach
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Stezenbach @ 2002-03-20 13:01 UTC (permalink / raw)
  To: Krishna Kondaka; +Cc: linux-mips

On Tue, Mar 19, 2002 at 12:13:54PM -0800, Krishna Kondaka wrote:
> 	I would like to know if there is a system call/library function 
> 	available in linux which prints the current stack trace of the 
> 	application.

The Glib has a function g_on_error_stack_trace() which does this
in a slightly hackish way by attaching gdb to the crashed program
(to be called from a SIGSEGV handler).
Look at gbacktrace.c there:
http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=glib/glib&module=.

HTH,
Johannes

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-20 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-19 20:13 Application stack trace facility Krishna Kondaka
2002-03-20 13:01 ` Johannes Stezenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox