The display of
  ">I>",                               // TRACE_PREFIX_INVOCATION
  "<I<",                               // TRACE_PREFIX_INVOCATION_EXIT
is activated by
    trace A
    trace I
    trace L
    trace R

All these trace instructions set the flag TraceSetting::traceLabels (see code 
review below).

It's only when the trace label is global to the package (::option) that the 
invocation entry is traced.
If you activate a trace label from inside a routine or method then the 
invocation entry is not traced.

To make everybody happy, we could retro-trace the invocation entry if not yet 
traced.
That would be done when executing a trace instruction which sets the flag 
TraceSetting::traceLabels.
(did not check the feasibility but seems feasible...)

That's useful when needing only a local trace in a few methods, instead of a 
full trace at package level.
I have some methods where I do that:
::method myMethod
    use strict arg <some arguments>, trace=.false
    if trace then .traceOutput~say("       >I> Method .myClass~myMethod")
    if trace then trace i
    ...

If we implement the retro-trace then
- I can remove the display of >I> from my code.
- We retrieve the symmetry advocated by Josep Maria.

To have a consistent trace, the retro-trace should be activated only if the 
trace instruction is the first instruction (or the second if the first 
instruction is an expose).


Code review, search for:
tracingLabels
traceLabels
traceEntryOrExit



> On 18.05.2024 16:57, Josep Maria Blasco wrote:
>> The new multitasking tracing features introduce a new form of trace output 
>> with a "<I<" prefix. The documentation for this particular form of output 
>> (rexxref 2.29.5. *CHG* The Format of Trace Output, pp. 84--5) says
>> 
>> <I< *NEW*
>> Identifies an exit (return) from an invocation of a routine or method. This 
>> trace entry will only appear if tracing is enabled using the ::OPTIONS 
>> directive using TRACE A, TRACE R, TRACE I or TRACE L.
>> 
>> Now please consider:
>> 
>> Call P
>> 
>> ::Routine P
>> 
>> Trace ?a
>> 
>> 
>> This produces a single line of tracing:
>> 
>> 
>> 
>> <I< Routine "P" in package "D:\Dropbox\parser\test.rex".
>> 
>> 
>> 
>> But (obviously) there is no OPTIONS directive.
>> 
>> 
>> 
>> This can be either considered as an interpreter bug, or as a documentation 
>> bug.
>> 
>> 
>> 
>> A) As an interpreter bug, "<I<" tracing should be suppressed when only 
>> "Trace a" is active, but no "::OPTIONS TRACE" is in effect.
>> 
>> 
>> 
>> B) As a documentation bug, the documentation should be amended to indicate 
>> that "Trace a" does also trigger this form of tracing.
>> 
>> 

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to