help on a GPF situation

help on a GPF situation

Postby Antonio Linares » Fri Oct 25, 2013 10:10 am

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: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 25, 2013 1:06 pm

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: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 25, 2013 1:23 pm

How to build Harbour with this flag:

go.bat
Code: Select all  Expand view  RUN
set path=c:\bcc582\bin
set HB_USER_CFLAGS=-DHB_PRG_TRACE
win-make.exe
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 25, 2013 1:28 pm

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: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 25, 2013 11:03 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby karinha » Wed Oct 30, 2013 5:51 pm

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
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: help on a GPF situation

Postby Antonio Linares » Wed Oct 30, 2013 6:06 pm

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
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby karinha » Wed Oct 30, 2013 6:44 pm

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: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: help on a GPF situation

Postby karinha » Thu Oct 31, 2013 12:04 pm

Code: Select all  Expand view  RUN

#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: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: help on a GPF situation

Postby karinha » Thu Oct 31, 2013 5:48 pm

Code: Select all  Expand view  RUN

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

Re: help on a GPF situation

Postby Antonio Linares » Fri Nov 01, 2013 8:41 am

João,

gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 22, 2021 10:47 am

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
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: help on a GPF situation

Postby karinha » Fri Oct 22, 2021 1:22 pm

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 view  RUN

//-> \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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: help on a GPF situation

Postby karinha » Fri Oct 22, 2021 1:28 pm

En xHarbour:

Code: Select all  Expand view  RUN


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
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: help on a GPF situation

Postby Antonio Linares » Fri Oct 22, 2021 3:17 pm

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

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 37 guests