FireBirdLib - Topfield TMS PVR TAP Programming Library
CallTraceEnter.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
#include "
FBLib_debug.h
"
3
4
void
CallTraceEnter
(
char
*ProcName)
5
{
6
char
Spaces[101];
7
byte
*ISOText;
8
extern
dword
__tap_ud__
;
9
10
if
(
CallTraceDoNotReenter
)
return
;
11
CallTraceDoNotReenter
= TRUE;
12
13
if
(!
CallTraceInitialized
)
CallTraceInit
();
14
15
if
(
CallLevel
>=
CTSTACKSIZE
)
LogEntryFBLibPrintf
(TRUE,
"CallLevel Overflow! (TAPID 0x%8.8lx)"
,
__tap_ud__
);
16
17
if
(ProcName)
18
{
19
if
(
CallTraceEnabled
)
20
{
21
StrToISOAlloc
(ProcName, &ISOText);
22
memset(Spaces,
' '
,
CallLevel
<
CTSTACKSIZE
?
CallLevel
<< 1 : 100);
23
Spaces[
CallLevel
<
CTSTACKSIZE
?
CallLevel
<< 1 : 100] =
'\0'
;
24
TAP_Print
(
"%s%s\n"
, Spaces, ISOText);
25
TAP_MemFree(ISOText);
26
}
27
28
//Add the current routine to the stack
29
if
(
CallLevel
<
CTSTACKSIZE
)
30
{
31
CallTraceStack
[
CallLevel
].
ProcName
= ProcName;
32
CallTraceStack
[
CallLevel
].
EntryTime
= TAP_GetTick();
33
}
34
}
35
36
CallLevel
++;
37
CallTraceDoNotReenter
= FALSE;
38
}
CallTraceEnter
void CallTraceEnter(char *ProcName)
Definition:
CallTraceEnter.c:4
CallTraceStack
tCallTraceStack CallTraceStack[CTSTACKSIZE]
Definition:
CallTraceInit.c:4
CallTraceInitialized
bool CallTraceInitialized
Definition:
CallTraceInit.c:6
CallLevel
dword CallLevel
Definition:
CallTraceInit.c:3
CallTraceEnabled
bool CallTraceEnabled
Definition:
CallTraceInit.c:5
CallTraceDoNotReenter
bool CallTraceDoNotReenter
Definition:
CallTraceInit.c:9
CallTraceInit
void CallTraceInit(void)
Definition:
CallTraceInit.c:11
FBLib_debug.h
CTSTACKSIZE
#define CTSTACKSIZE
Definition:
FBLib_debug.h:7
__tap_ud__
const dword __tap_ud__
LogEntryFBLibPrintf
void LogEntryFBLibPrintf(bool Console, char *format,...)
Definition:
LogEntryFBLibPrintf.c:13
TAP_Print
#define TAP_Print
Definition:
libFireBird.h:181
StrToISOAlloc
void StrToISOAlloc(const byte *SourceString, byte **DestString)
Definition:
StrToISOAlloc.c:5
tCallTraceStack::ProcName
char * ProcName
Definition:
FBLib_debug.h:22
tCallTraceStack::EntryTime
dword EntryTime
Definition:
FBLib_debug.h:23
debug
CallTraceEnter.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3