/[svn]/linuxsampler/trunk/src/common/stacktrace.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/common/stacktrace.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 270 - (hide annotations) (download) (as text)
Fri Oct 8 20:30:25 2004 UTC (19 years, 6 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 1944 byte(s)
stacktrace routines by Bjorn Reese, only slightly modified:
- header file adjusted to work with C++ applications
- deactivated separated piping of debugger output, as it didn't work out
  correctly in multithreaded application

1 schoenebeck 270 /*************************************************************************
2     *
3     * $Id: stacktrace.h,v 1.1 2004-10-08 20:30:25 schoenebeck Exp $
4     *
5     * Copyright (c) 1998 by Bjorn Reese <breese@mail1.stofanet.dk>
6     *
7     * Permission to use, copy, modify, and distribute this software for any
8     * purpose with or without fee is hereby granted, provided that the above
9     * copyright notice and this permission notice appear in all copies.
10     *
11     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
12     * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
13     * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
14     * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
15     *
16     ************************************************************************
17     *
18     * Purpose:
19     * To generate a stacktrace of a program.
20     *
21     * Description:
22     * If a debugger is located on the machine we will try this first,
23     * as it usually give better information than built-in methods.
24     * The debugger needs the name of the program to be able to attach
25     * to it, so this must be passed to StackTraceInit(). The second
26     * argument is a filedescriptor that StackTrace() writes to. If this
27     * argument is -1 then standard output will be used.
28     *
29     * Compilation:
30     * Some platforms have a built-in method to generate stacktraces, but
31     * they are usually located in some non-standard library. The following
32     * are supported:
33     *
34     * IRIX Compile with -DUSE_BUILTIN and -lexc
35     * HP/UX Compile with -DUSE_BUILTIN and -lcl
36     * GCC Compile with -DUSE_BUILTIN
37     *
38     ************************************************************************/
39    
40     #ifndef H_DEBUG_STACKTRACE
41     #define H_DEBUG_STACKTRACE
42    
43     #if defined(__cplusplus)
44     extern "C" {
45     #endif // __cplusplus
46    
47     void StackTrace(void);
48     void StackTraceInit(const char *progname, int handle);
49    
50     #if defined(__cplusplus)
51     }
52     #endif // __cplusplus
53    
54     #endif /* H_DEBUG_STACKTRACE */

  ViewVC Help
Powered by ViewVC