From ef342897c206fb8d72208d926c5fa3d831cb2ac7 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 24 Jan 2002 10:30:07 +0000 Subject: [PATCH] 2002-01-24 10:27 UTC+0000 Dave Pearson * source/rtl/profiler.prg * HBProfileLowLevel:gatherOPCodes() wasn't making a call to HBProfile:ignoreSymbol() to allow for opcode filtering in sub classes. Fixed. * Improved the formatting of OPCODE names so that they sort properly. --- harbour/ChangeLog | 8 ++++++++ harbour/source/rtl/profiler.prg | 21 +++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3fed52adb2..d1ff687ed7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ * tests/testpers.prg + +2002-01-25 00:40 UTC-0800 Brian Hays + * HBProfileLowLevel:gatherOPCodes() wasn't making a call to + * added arg to StrTran in LoadFromText() to limit conversion of + "=" to ":=" to only the first instance, so data containing + a "=" doesn't get changed + * fixed ValToText() so data containing embedded quotes doesn't + Tests if the string contains a " and uses single quotes instead, or use [] if it contains both. Future enhancement should cover if contains all 3.... diff --git a/harbour/source/rtl/profiler.prg b/harbour/source/rtl/profiler.prg index d887bf60c1..3fd8b81962 100644 --- a/harbour/source/rtl/profiler.prg +++ b/harbour/source/rtl/profiler.prg @@ -307,7 +307,6 @@ End Class Method describe Class HBProfileOPCode Return( "OPCode" ) - //////////////////////////////////////////////////////////////////////////// // Class: HBProfile @@ -558,18 +557,32 @@ End Class ///// Method gather Class HBProfileLowLevel -Return( ::super:gather():gatherOPCodes() ) +Local lProfile := __setProfiler( .F. ) + + // Gather functions and methods. + ::super:gather() + + // Also gather opcodes. + ::gatherOPCodes() + + __setProfiler( lProfile ) + +Return( self ) ///// Method gatherOPCodes Class HBProfileLowLevel Local nMax := __opcount() +Local cName Local nOP // Loop over all the harbour OP codes. Note that they start at 0. For nOP := 0 To ( nMax - 1 ) - // Add it to the profile. - aadd( ::aProfile, HBProfileOPCode():new( "OPCODE( " + alltrim( str( nOP ) ) + " )", __OpGetPrf( nOP ) ) ) + // If we're not ignoring this opcode. + If !::ignoreSymbol( cName := "OPCODE( " + padl( nOP, 3 ) + " )" ) + // Add it to the profile. + aadd( ::aProfile, HBProfileOPCode():new( cName, __OpGetPrf( nOP ) ) ) + EndIf Next Return( self )