ChangeLogTag:Mon Oct 25 13:14:42 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>

This commit is contained in:
Gonzalo A. Diethelm
1999-10-25 16:36:38 +00:00
parent ed752ded2a
commit 4c5cb1c381
16 changed files with 115 additions and 29 deletions

View File

@@ -1,3 +1,30 @@
Mon Oct 25 13:14:42 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* doc/tracing.txt:
* include/hbtrace.h:
* source/common/hbtrace.c:
* source/pp/hbpp.c:
* source/pp/hbppint.c:
* source/pp/hbpplib.c:
* source/pp/table.c:
* source/pp/stdalone/hbpp.c:
Changed the environment variables that enable tracing in Harbour,
and added a document explaining how to do tracing.
* include/hbsetup.h:
* source/rtl/gt/gtcrs.c:
* source/rtl/gt/gtlin.c:
* source/rtl/gtxxx.c:
Changed the name for the curses-based GT implementation file to
gtcrs.c, leaving room for other linux-oriented implementations
such as s-lang, etc.
* source/rtl/arrays.c:
* source/rtl/fm.c:
* source/rtl/gtapi.c:
* source/rtl/inkey.c:
Added/corrected a few calls to HB_TRACE().
19991025-15:20 GMT+1 Victor Szel <info@szelvesz.hu>
* tests/memory.prg
+ Using hbmemory.ch

45
harbour/doc/tracing.txt Normal file
View File

@@ -0,0 +1,45 @@
#
# $Id$
#
INTRODUCTION
============
This file explains how to enable tracing in Harbour.
TRACING
=======
You can enable tracing in Harbour by setting the following environment
variable to any number greater than zero and then recompiling Harbour:
HB_TRACE_LEVEL
The value is of no importance right now, just the fact that the
variable is defined to a value greater than zero is taken into
account. In the future, it may be possible to enable different
tracing levels by setting the variable to different values.
When Harbour is compiled with the variable is set as described above,
and then used to compile a regular Harbour application, the app will
output LOTS of tracing information to stderr. If you are using a
sensible command shell (such as bash) you can redirect stderr to a
file like this:
my_app 2>trace.txt
TRACING THE PREPROCESSOR AND COMPILER
=====================================
Usually, you will not want tracing enabled in the preprocessor and
compiler; otherwise, you will see the trace output while compiling
Harbour itself. If you REALLY want to enable tracing in the
preprocessor and/or compiler, you must define, in addition to
HB_TRACE_LEVEL as described above, the following variable, and then
recompile the preprocessor/compiler:
HB_TRACE_UTILS
The value is of no importance.

View File

@@ -156,14 +156,14 @@
/*#define HARBOUR_USE_DOS_GTAPI*/
/*#define HARBOUR_USE_OS2_GTAPI*/
/*#define HARBOUR_USE_WIN_GTAPI*/
/*#define HARBOUR_USE_LIN_GTAPI*/
/*#define HARBOUR_USE_CRS_GTAPI*/
/* Indicate that one of the GTAPIs is defined */
#if defined(HARBOUR_USE_STD_GTAPI) || \
defined(HARBOUR_USE_DOS_GTAPI) || \
defined(HARBOUR_USE_OS2_GTAPI) || \
defined(HARBOUR_USE_WIN_GTAPI) || \
defined(HARBOUR_USE_LIN_GTAPI)
defined(HARBOUR_USE_CRS_GTAPI)
#define HARBOUR_USE_GTAPI
#endif

View File

@@ -36,7 +36,7 @@
#ifndef HB_TRACE_H_
#define HB_TRACE_H_
#if defined(HB_DO_TRACE)
#if (defined(HB_TRACE_LEVEL) && (HB_TRACE_LEVEL > 0))
extern char * hb_tr_file_;
extern int hb_tr_line_;
@@ -54,6 +54,6 @@ do { \
#define HB_TRACE( x )
#endif /* #if defined(HB_DO_TRACE) */
#endif /* #if (defined(HB_TRACE_LEVEL) && (HB_TRACE_LEVEL > 0)) */
#endif /* HB_TRACE_H_ */

View File

@@ -33,7 +33,7 @@
*
*/
#if defined(HB_DO_TRACE)
#if (defined(HB_TRACE_LEVEL) && (HB_TRACE_LEVEL > 0))
#include <stdio.h>
#include <stdarg.h>
@@ -93,5 +93,4 @@ void hb_tr_trace( char * fmt, ... )
hb_tr_line_ = 0;
}
#endif /* #if defined(HB_DO_TRACE) */
#endif /* #if (defined(HB_TRACE_LEVEL) && (HB_TRACE_LEVEL > 0)) */

View File

@@ -36,9 +36,9 @@
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL)
#endif
#endif

View File

@@ -36,9 +36,9 @@
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL)
#endif
#endif

View File

@@ -36,9 +36,9 @@
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL)
#endif
#endif

View File

@@ -36,9 +36,9 @@
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL)
#endif
#endif

View File

@@ -36,9 +36,9 @@
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#if ! defined(HB_TRACE_UTILS)
#if defined(HB_TRACE_LEVEL)
#undef HB_TRACE_LEVEL)
#endif
#endif

View File

@@ -757,7 +757,11 @@ PHB_ITEM hb_arrayClone( PHB_ITEM pSrcArray )
*/
static void hb_arrayNewRagged( PHB_ITEM pArray, int iDimension )
{
ULONG ulElements = ( ULONG ) hb_parnl( iDimension );
ULONG ulElements;
HB_TRACE(("hb_arrayNewRagged(%p, %d)", pArray, iDimension));
ulElements = ( ULONG ) hb_parnl( iDimension );
/* create an array */
hb_arrayNew( pArray, ulElements );

View File

@@ -283,6 +283,8 @@ ULONG hb_xquery( USHORT uiMode )
{
ULONG ulResult;
HB_TRACE(("hb_xquery(%hu)", uiMode));
/* TODO: Return the correct values instead of 9999 [vszel] */
switch( uiMode )

View File

@@ -4,7 +4,7 @@
/*
* Harbour Project source code:
* Video subsystem for Linux (based on ncurses).
* Video subsystem based on ncurses.
*
* Copyright 1999 Gonzalo Diethelm <gonzalo.diethelm@iname.com>
*

View File

@@ -751,6 +751,8 @@ USHORT hb_gtRepChar( USHORT uiRow, USHORT uiCol, BYTE byChar, USHORT uiCount )
USHORT hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * vlpScrBuff )
{
HB_TRACE(("hb_gtRest(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, vlpScrBuff));
hb_gt_PutText( uiTop, uiLeft, uiBottom, uiRight, ( BYTE * ) vlpScrBuff );
return 0;
@@ -758,6 +760,8 @@ USHORT hb_gtRest( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight,
USHORT hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, void * vlpScrBuff )
{
HB_TRACE(("hb_gtSave(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, vlpScrBuff));
hb_gt_GetText( uiTop, uiLeft, uiBottom, uiRight, ( BYTE * ) vlpScrBuff );
return 0;
@@ -967,8 +971,13 @@ USHORT hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight
USHORT hb_gtDrawShadow( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr )
{
USHORT uiMaxRow = hb_gtMaxRow();
USHORT uiMaxCol = hb_gtMaxCol();
USHORT uiMaxRow;
USHORT uiMaxCol;
HB_TRACE(("hb_gtDrawShadow(%hu, %hu, %hu, %hu, %d)", uiTop, uiLeft, uiBottom, uiRight, (int) byAttr));
uiMaxRow = hb_gtMaxRow();
uiMaxCol = hb_gtMaxCol();
uiLeft += 2;
uiBottom++;

View File

@@ -43,8 +43,8 @@
#include "gt/gtos2.c"
#elif defined(HARBOUR_USE_WIN_GTAPI)
#include "gt/gtwin.c"
#elif defined(HARBOUR_USE_LIN_GTAPI)
#include "gt/gtlin.c"
#elif defined(HARBOUR_USE_CRS_GTAPI)
#include "gt/gtcrs.c"
#else
#include "gt/gtstd.c"
#endif

View File

@@ -777,7 +777,7 @@ printf("\nhb_inkeyPoll: wKey is %d", wKey);
case 396: /* Alt + F12 */
ch = 349 - ch;
}
#elif defined(OS_UNIX_COMPATIBLE)
#elif defined(HARBOUR_USE_CRS_GTAPI)
#if 1
ch = hb_gtReadKey();
#else