Page 1 of 2
help on a GPF situation
Posted: Fri Oct 25, 2013 10:10 am
by Antonio Linares
I am looking for a working example using __TracePrgCalls( .T. ) as per the docs:
* Once the tracing decribed below is turned on, you can call this
* in a PRG to trace PRG-level function calls:
*
* __TRACEPRGCALLS( <lOnOff> ) --> <lOldValue>
*
* It turns on|off tracing of PRG-level function and method calls.
* The symbol name is written just before it's called.
* 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.
Is someone using it ? thanks
This may help many of us when a GPF suddenly happens

Re: help on a GPF situation
Posted: Fri Oct 25, 2013 1:06 pm
by Antonio Linares
This is the story about what happened with this feature:
http://comments.gmane.org/gmane.comp.lang.xharbour.devel/2053So, we have to rebuild hbvm.lib with -DHB_PRG_TRACE
Re: help on a GPF situation
Posted: Fri Oct 25, 2013 1:23 pm
by Antonio Linares
How to build Harbour with this flag:
go.bat
Code: Select all | Expand
set path=c:\bcc582\bin
set HB_USER_CFLAGS=-DHB_PRG_TRACE
win-make.exe
Re: help on a GPF situation
Posted: Fri Oct 25, 2013 1:28 pm
by Antonio Linares
From our apps we have to do:
hb_TraceSysOut( .T. )
__TracePrgCalls( .T. )
Re: help on a GPF situation
Posted: Fri Oct 25, 2013 11:03 pm
by Antonio Linares
Re: help on a GPF situation
Posted: Wed Oct 30, 2013 5:51 pm
by karinha
Maestro en xHarbour me retorna esto error:
Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved.
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_HB_FUN_HB_TRACESYSOUT' referenced from C:
Que hacer?
Gracias, saludos.
Re: help on a GPF situation
Posted: Wed Oct 30, 2013 6:06 pm
by Antonio Linares
João,
Puede ser que hb_TraceSysOut() sea una función de Harbour solamente. He revisado el código fuente de esas funciones en Harbour pero no las miré en xHarbour.
Prueba solo con __TracePrgCalls( .T. )
Re: help on a GPF situation
Posted: Wed Oct 30, 2013 6:44 pm
by karinha
Maestro en xHarbour esto está correcto?
#define HB_TR_DEBUG 5
HB_TR_FLUSH=1
HB_TR_LEVEL=HB_TR_DEBUG
HB_TR_OUTPUT= "c:\trace.txt"
And in our code:
hb_tracestate(1)
__TracePrgCalls( .t. )
doesn't create c:\trace.txt anymore.
http://marcosgambeta.files.wordpress.co ... 100802.pdfRegards,
Re: help on a GPF situation
Posted: Thu Oct 31, 2013 12:04 pm
by karinha
Code: Select all | Expand
#Define HB_TR_DEBUG 5
// hb_TraceSysOut( .T. ) // Funciona en Harbour no [x]Harbour
HB_TR_FLUSH=1
HB_TR_LEVEL=HB_TR_DEBUG
HB_TR_OUTPUT = cDirPleno + "TRACE.LOG"
//And in our code:
// To trace calls for FWH
__TRACEPRGCALLS( .T. )
HB_TRACELEVEL( 5 )
HB_TRACESTATE(1)
Re: help on a GPF situation
Posted: Thu Oct 31, 2013 5:48 pm
by karinha
Code: Select all | Expand
// testtrac.prg
#include "FiveWin.ch"
#define HB_TR_ALWAYS 0
#define HB_TR_FATAL 1
#define HB_TR_ERROR 2
#define HB_TR_WARNING 3
#define HB_TR_INFO 4
#define HB_TR_DEBUG 5
#define HB_TR_LEVEL_ALWAYS 0
#define HB_TR_LEVEL_FATAL 1
#define HB_TR_LEVEL_ERROR 2
#define HB_TR_LEVEL_WARNING 3
#define HB_TR_LEVEL_INFO 4
#define HB_TR_LEVEL_DEBUG 5
FUNCTION MAIN()
? "TRACING STATUS"
__TRACEPRGCALLS( .T. )
? "hb_traceLevel", hb_traceLevel()
? "hb_traceState", hb_traceState()
? "LEVEL: HB_TR_ALWAYS", HB_TRACELEVEL( HB_TR_ALWAYS )
? "LEVEL: HB_TR_FATAL", HB_TRACELEVEL( HB_TR_FATAL )
? "LEVEL: HB_TR_ERROR", HB_TRACELEVEL( HB_TR_ERROR )
? "LEVEL: HB_TR_WARNING", HB_TRACELEVEL( HB_TR_WARNING )
? "LEVEL: HB_TR_INFO", HB_TRACELEVEL( HB_TR_INFO )
? "LEVEL: HB_TR_DEBUG", HB_TRACELEVEL( HB_TR_DEBUG )
RETURN NIL
Re: help on a GPF situation
Posted: Fri Nov 01, 2013 8:41 am
by Antonio Linares
João,
gracias!

Re: help on a GPF situation
Posted: Fri Oct 22, 2021 10:47 am
by Antonio Linares
Joao,
Conseguiste que te funcionase hb_traceSysOut( .T. ) que envía los mensajes con OutputDebugString() ?
Debe hacer que la salida sea por DbWin32 (por DebugView parece que no funciona)
gracias por tu ayuda!
Re: help on a GPF situation
Posted: Fri Oct 22, 2021 1:22 pm
by karinha
Buenos días Maestro, No. Lo pregunté en el foro FiveWin Brasil, y nadie sabía de la existencia de este comando.
Code: Select all | Expand
//-> \SAMPLES\HBSENHA.PRG
#Include "FiveWin.ch"
#define HB_TR_ALWAYS 0
#define HB_TR_FATAL 1
#define HB_TR_ERROR 2
#define HB_TR_WARNING 3
#define HB_TR_INFO 4
#define HB_TR_DEBUG 5
#define HB_TR_LEVEL_ALWAYS 0
#define HB_TR_LEVEL_FATAL 1
#define HB_TR_LEVEL_ERROR 2
#define HB_TR_LEVEL_WARNING 3
#define HB_TR_LEVEL_INFO 4
#define HB_TR_LEVEL_DEBUG 5
MEMVAR cText ,cKey, cEncrypted, cPassWord
FUNCTION Main()
*---------------------------------------------------------------------------------------*
#pragma TEXTHIDDEN(1)
PUBLIC cPassWord := "Q65h3l8j41B" // <- Very important not to change Password or Delete !!! <------- "Top Secret ;-)"
#pragma TEXTHIDDEN(0)
*---------------------------------------------------------------------------------------*
__TRACEPRGCALLS( .T. )
cText := "This is my secret message."
cKey := HB_blowfishKey( cPassWord )
MsgInfo( "Original: " + HB_StrToExp( cText ) )
/* encrypt data */
#ifdef __XHARBOUR__ // xHarbour
MsgInfo( "Encrypted: " + StrToHex( cEncrypted := HB_blowfishEncrypt( cKey, cText ) ) )
#else // Harbour
MsgInfo( "Encrypted: " + HB_StrToHex( cEncrypted := HB_blowfishEncrypt( cKey, cText ) ) )
#endif
/* decrypt data */
MsgInfo( "Decrypted: " + HB_StrToExp( HB_blowfishDecrypt( cKey, cEncrypted ) ) )
? "hb_traceLevel", hb_traceLevel()
? "hb_traceState", hb_traceState()
/*
? "LEVEL: HB_TR_ALWAYS", HB_TRACELEVEL( HB_TR_ALWAYS )
? "LEVEL: HB_TR_FATAL", HB_TRACELEVEL( HB_TR_FATAL )
? "LEVEL: HB_TR_ERROR", HB_TRACELEVEL( HB_TR_ERROR )
? "LEVEL: HB_TR_WARNING", HB_TRACELEVEL( HB_TR_WARNING )
? "LEVEL: HB_TR_INFO", HB_TRACELEVEL( HB_TR_INFO )
? "LEVEL: HB_TR_DEBUG", HB_TRACELEVEL( HB_TR_DEBUG )
*/
RETURN NIL
FUNCTION StrToHex( cString )
RETURN Lower( cString )
// FIN
Regards, saludos.
Re: help on a GPF situation
Posted: Fri Oct 22, 2021 1:28 pm
by karinha
En xHarbour:
Code: Select all | Expand
HBSENHA.c:
Error: Unresolved external '_HB_FUN_HB_TRACESYSOUT'
Error: Unable to perform link
* Linking errors *
Regards, saludos.
Re: help on a GPF situation
Posted: Fri Oct 22, 2021 3:17 pm
by Antonio Linares
Tenemos que conseguir poder visualizar toda la actividad de Harbour ahi

