1 | #ifndef MMBT_H |
---|
2 | #define MMBT_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id: mmbt.h,v 1.7 1999-11-15 17:20:23 obachman Exp $ */ |
---|
7 | /* |
---|
8 | * ABSTRACT: backtrace: part of memory subsystem (for linux/elf) |
---|
9 | * needed programs: - mprpc to set the variable MPRPC |
---|
10 | * - mprdem: must be in the current directory |
---|
11 | * - mprnm: must be in thje current directory |
---|
12 | * files: - Singularg: the name of the executable |
---|
13 | * - nm.log: temp. file for the map address -> name |
---|
14 | */ |
---|
15 | |
---|
16 | #ifdef MTRACK |
---|
17 | /* the maximal level of stacks to remember in debug (MTRACK) mode */ |
---|
18 | #define BT_MAXSTACK 10 |
---|
19 | |
---|
20 | // #ifndef __OPTIMIZE__ |
---|
21 | /* does only work in debug mode: |
---|
22 | * requires that -fomit-frame-pointer is not given |
---|
23 | */ |
---|
24 | #if defined(linux) && defined(__i386__) |
---|
25 | |
---|
26 | int mmTrackInit (); /* init. of global variables */ |
---|
27 | void mmTrack (unsigned long *bt_stack); /* store the current stack into bt_stack */ |
---|
28 | |
---|
29 | void mmP2cNameInit(); /* init. of PC -> Name resolution */ |
---|
30 | char * mmP2cName(unsigned long p); /* PC -> Name resolution */ |
---|
31 | void mmPrintStack(FILE *fd, unsigned long *stack, int mm); |
---|
32 | void mmDBPrintStack(FILE *fd, void* memblock, int mm); |
---|
33 | void mmDBPrintStackFrames(FILE *fd, void* memblock, int start, int end); |
---|
34 | void mmPrintStackFrames(FILE *fd, unsigned long *bt_stack, int start, int end, int mm); |
---|
35 | void mmDBPrintThisStack(FILE *fd, void* memblock, int all, int free); |
---|
36 | #endif /* linux, i386 */ |
---|
37 | // #endif /* not optimize */ |
---|
38 | #endif /* MTRACK */ |
---|
39 | |
---|
40 | #endif /* MMBT_H */ |
---|