help on a GPF situation

User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

help on a GPF situation

Post 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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

This is the story about what happened with this feature:

http://comments.gmane.org/gmane.comp.lang.xharbour.devel/2053

So, we have to rebuild hbvm.lib with -DHB_PRG_TRACE
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

How to build Harbour with this flag:

go.bat

Code: Select all | Expand

set path=c:\bcc582\binset HB_USER_CFLAGS=-DHB_PRG_TRACEwin-make.exe
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

From our apps we have to do:

hb_TraceSysOut( .T. )
__TracePrgCalls( .T. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post 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. )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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.pdf

Regards,
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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) 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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      5FUNCTION 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 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

João,

gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post 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!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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    5MEMVAR cText ,cKey, cEncrypted, cPassWordFUNCTION 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 NILFUNCTION StrToHex( cString ) RETURN Lower( cString )// FIN 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
Posts: 7963
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 5 times
Contact:

Re: help on a GPF situation

Post 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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Antonio Linares
Site Admin
Posts: 42655
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 67 times
Been thanked: 96 times
Contact:

Re: help on a GPF situation

Post by Antonio Linares »

Tenemos que conseguir poder visualizar toda la actividad de Harbour ahi :-)

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply