2001-11-01 05:10 UTC-0800 Brian Hays <bhays@abacuslaw.com>

This commit is contained in:
Brian Hays
2001-11-02 01:11:29 +00:00
parent 83e9bf8c78
commit d2f1655bdb
4 changed files with 63 additions and 5 deletions

View File

@@ -1,3 +1,27 @@
2001-11-01 05:10 UTC-0800 Brian Hays <bhays@abacuslaw.com>
* harbour/include/hbsetup.h
* Wrapped HB_FM_STATISTICS in #ifndef test so it can be
turned off by defining
HB_FM_STATISTICS_OFF in your make or bat files.
* harbour/source/rtl/trace.c
+ added HB_TRACESTRING() which lets prg code trace a
string into same trace file/window as C traces
* harbour/source/vm/hvm.c
+ added __TRACEPRGCALLS( <lOnOff> ) --> <lOldValue>
Turns on | off tracing of PRG-level function and
method calls. Dumps symbol name just before it's called.
Implementation follows example of
the Profiler; all actions are wrapped in an
"if" of a BOOL so there should be no performance
hit if it's turned off.
This is very useful when debugging GPFs as it will
trace all PRG-level calls up until the crash.
Uses HB_TRACE so traces are in line with any
C-level traces.
2001-11-01 18:30 GMT+1 Martin Vogel <vogel@inttec.de>
+ contrib/libct/datetime.prg

View File

@@ -56,13 +56,13 @@
#include <limits.h>
/* ***********************************************************************
* Include settings common for .PRG and .C files
* Include settings common for .PRG and .C files
*/
#include "hbsetup.ch"
/* ***********************************************************************
* NOTE: You can select the default language modul used by Harbour, by
* defining this to a valid language modul identifier.
* defining this to a valid language modul identifier.
*/
#ifndef HB_LANG_DEFAULT
@@ -119,9 +119,11 @@
* Note that if you turn this on, Harbour will be slighlty slower, larger
* and will consume more memory.
*
* By default this is turned on.
* By default this is turned on. Define HB_FM_STATISTICS_OFF to turn it off.
*/
#define HB_FM_STATISTICS
#ifndef HB_FM_STATISTICS_OFF
#define HB_FM_STATISTICS
#endif
/* ***********************************************************************
* This symbol defines if we want an ability to create and link OBJ files
@@ -195,7 +197,7 @@
* that the set of items doesn't change (there're no deleted or new
* items, just swapping) in this functions.
* Using this option makes sorting *much* faster, but if you have a
* problem, or the low level stuff changes, turn it off. [vszakats]
* problem, or the low level stuff changes, turn it off. [vszakats]
*/
#define HB_ASORT_OPT_ITEMCOPY

View File

@@ -51,6 +51,7 @@
*/
#include "hbapi.h"
#include "hbtrace.h"
#ifdef HB_EXTENSION
@@ -64,5 +65,10 @@ HB_FUNC( HB_TRACELEVEL )
hb_retni( hb_tracelevel( ISNUM( 1 ) ? hb_parni( 1 ) : -1 ) );
}
HB_FUNC( HB_TRACESTRING )
{
HB_TRACE(HB_TR_ALWAYS, (hb_parc( 1 )) );
}
#endif

View File

@@ -232,6 +232,7 @@ extern void * hb_mthRequested( void ); /* profiler from classes.c */
extern void hb_mthAddTime( void *, ULONG ); /* profiler from classes.c */
BOOL hb_bProfiler = FALSE; /* profiler status is off */
BOOL hb_bTracePrgCalls = FALSE; /* prg tracing is off */
/* virtual machine state */
@@ -3046,6 +3047,9 @@ void hb_vmDo( USHORT uiParams )
if( bProfiler )
pMethod = hb_mthRequested();
if ( hb_bTracePrgCalls )
HB_TRACE(HB_TR_ALWAYS, ("Calling: %s", pSym->szName));
pFunc();
if (lPopSuper && pSelfBase->puiClsTree)
@@ -3093,6 +3097,9 @@ void hb_vmDo( USHORT uiParams )
pSym->pDynSym->ulRecurse++;
}
if ( hb_bTracePrgCalls )
HB_TRACE(HB_TR_ALWAYS, ("Calling: %s", pSym->szName));
pFunc();
if( bProfiler && pSym->pDynSym )
@@ -3205,6 +3212,9 @@ void hb_vmSend( USHORT uiParams )
if( bProfiler )
pMethod = hb_mthRequested();
if ( hb_bTracePrgCalls )
HB_TRACE(HB_TR_ALWAYS, ("Calling: %s", pSym->szName));
pFunc();
if (lPopSuper && pSelfBase->puiClsTree)
@@ -3300,6 +3310,9 @@ void hb_vmSend( USHORT uiParams )
pSym->pDynSym->ulRecurse++;
}
if ( hb_bTracePrgCalls )
HB_TRACE(HB_TR_ALWAYS, ("Calling: %s", pSym->szName));
pFunc();
if( bProfiler && pSym->pDynSym )
@@ -4715,3 +4728,16 @@ HB_FUNC( __SETPROFILER )
hb_retl( bOldValue );
}
/* $Doc$
* $FuncName$ __TRACEPRGCALLS( <lOnOff> ) --> <lOldValue>
* $Description$ Turns on | off tracing of PRG-level function and method calls
* $End$ */
HB_FUNC( __TRACEPRGCALLS )
{
BOOL bOldValue = hb_bTracePrgCalls;
hb_bTracePrgCalls = hb_parl( 1 );
hb_retl( bOldValue );
}