Hi

Przemysław Czerpak wrote:
> 
> On Wed, 16 Dec 2009, Pritpal Bedi wrote:
> -DHB_TR_LEVEL_* is compile time macro used to strip from source code
> by PP all HB_TRACE() massages which have bigger priority value.
> By default it's set to: HB_TR_LEVEL_WARNING what means that:
>    HB_TRACE(HB_TR_ALWAYS,  ... );   /* 0 */
>    HB_TRACE(HB_TR_FATAL,   ... );   /* 1 */
>    HB_TRACE(HB_TR_ERROR,   ... );   /* 2 */
>    HB_TRACE(HB_TR_WARNING, ... );   /* 3 */
> are compiled and included in final binaries and:
>    HB_TRACE(HB_TR_INFO,    ... );   /* 4 */
>    HB_TRACE(HB_TR_DEBUG,   ... );   /* 5 */
> are stripped by C preprocessor before compilation so no code is
> generated for them.
> 

Thanks Przemek for educating us how HB_TRACE works.

I, infact, could never understood its ins and outs so far.
Today I am equipped to exploit this tool in debugging.

Now I can trace PRG level calls in HBIDE with -D__HB_DEBUG__ define
which in turn invokes hb_TraceString( [x,,,,] ) which in turn executes
hb_tr_trace( HB_TR_ALWAYS,.. ).

But still I cannot capture HBQT HB_TRACE( HB_TR_DEBUG, ... ) calls.

HBQT compiles and shows up this in log:

gcc   -I. -I../../../../../include -Wall -W -O3 -fomit-frame-pointer
-march=i586 -mtune=pentiumpro  -Ic:\Qt\2009.03\qt\include
-Ic:\Qt\2009.03\qt\include/QtCore -Ic:\Qt\2009.03\qt\include/QtGui
-Ic:\Qt\2009.03\qt\include/QtNetwork -D__HB_WINDEBUG__ -D__HB_DEBUG__
-DHB_FM_STATISTICS -DHB_TR_LEVEL_DEBUG -ohbqt_destruct.o -c
../../../hbqt_destruct.cpp
gcc   -I. -I../../../../../include -Wall -W -O3 -fomit-frame-pointer
-march=i586 -mtune=pentiumpro  -Ic:\Qt\2009.03\qt\include
-Ic:\Qt\2009.03\qt\include/QtCore -Ic:\Qt\2009.03\qt\include/QtGui
-Ic:\Qt\2009.03\qt\include/QtNetwork -D__HB_WINDEBUG__ -D__HB_DEBUG__
-DHB_FM_STATISTICS -DHB_TR_LEVEL_DEBUG -ohbqt_events.o -c
../../../hbqt_events.cpp

which amply shows that HB_TR_LEVEL_DEBUG is passed to the compiler.

Other envar set are : HB_TR_WINOUT=1

What I am missing ?
Note that I am looking at output rendered by OutputDebugString() call in
hbtrace.c.

Moreover, in PRG level trace shows up info as:

trace.c:96: HB_TR_ALWAYS          0 Destroy: XBPTOOLBAR      1375326     
20376

and there trace.c:96 is the wrong info.



Regards
Pritpal Bedi

-- 
View this message in context: 
http://old.nabble.com/HB_TRACE%28%29---How-to-invoke-for-PRG-and-C-code-separately-tp26806243p26824189.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to