Previous Thread
Next Thread
Print Thread
++PRAGMA TRACE_BEGIN/TRACE_END bug #23900 29 Oct 18 10:31 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
I'm receiving unmapped variable errors with any function calls using named parameters.

I assume the compiler is not filtering out the named'parameter= portion of statement when generating the variables to be traced.

Linux Ashell ver: 6.5.1648.1
COMPIL/V 6.5(885)


Stephen Funkhouser
Diversified Data Solutions
Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug #23901 29 Oct 18 09:17 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
I have a lot of sample code using named parameters and haven't seen this, so I may need a specific example. Here's a simple one (that doesn't complain, at least with compiler 886) ...

Code
++pragma TRACE_BEGIN (0,"","$# $T","")
? fn'foo$(1, 2, name="jack")
end

Function fn'foo$(arg1 as b2:inputonly, arg2=5 as i2:inputonly, &
                name="joaquin" as s20:inputonly) as s0
    fn'foo$ = name + (arg1 * arg2)
EndFunction

Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug #23902 30 Oct 18 08:49 AM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Here's a link to download the latest ashdevxtr with TRACE_BEGIN/TRACE_END that results in


Code
ASHDEVXTR.GEN:15409: ?Unmapped variable: colnum  - IF (fn'dlg'xtr_xtr'select_setCformatAdvanced_isConstantData(colnum=x) = -1) THEN


Stephen Funkhouser
Diversified Data Solutions
Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug #23903 30 Oct 18 11:19 AM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
I see the problem - it arises only in IF statements. Should be fixed in the next update.

Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug #23904 31 Oct 18 11:35 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645

Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37135 22 Feb 24 10:37 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
I'm having an issue using TRACE_BEGIN/END without the optionlist, there are no trace.prints added.

If I add an option list such as, ++PRAGMA TRACE_BEGIN (2,"conv","",""), I can turn them on with set debug tags +conv

This is EL7 Version 7.0.1756.2


Stephen Funkhouser
Diversified Data Solutions
Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37137 23 Feb 24 12:43 AM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
I'm not sure if this is a feature, a bug, or just a documentation ambiguity. The issue appears to be that the actual default debug level (first arg in the options list) is one, not zero. Which is arguably a good thing, since it allows you to turn the tracing on and off with SET DEBUG {1} and SET NODEBUG.

If we were to make the default trace level be zero, then you wouldn't be able to turn those traces off.

Does that seem better? Or did this behavior change recently?

Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37138 23 Feb 24 03:19 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Thought using a TRACE_BEGIN/END block would work the same as trace.print "some trace".

The trace.print by itself doesn't require setting the debug level they just get traced. It seems a TRACE_BEGIN/END block should be consistent with the behavior of the trace.print


Stephen Funkhouser
Diversified Data Solutions
Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37140 23 Feb 24 05:07 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
That seems like a good logical point based on syntax consistency. I'm just not sure how practical it is though, since it means you have to modify the program to turn off the tracing. While that's true for trace.print as well, those are individual statements, which, at least in my case are used just like print statements to output messages unconditionally (errors, status, etc.) Otherwise, at least in my case, I always include the (level,"tags") argument so I can enable the traces selectively without recompiling.

The practical difference with the TRACE_BEGIN pragma is that it activates an onslaught of trace messages, making it hard (for me) to imagine ever wanting to unleash that unconditionally.

I'm also somewhat concerned that given the way it operates now, there may be programs with "silent" TRACE_BEGIN pragmas which would suddenly be activated by an A-Shell update if we changed the existing behavior. (Although admittedly, the likelihood of that isn't terribly great, considering that the documentation does seem to describe it your way.) Still, I can imagine the panic/embarrassment following an update when some long-forgotten TRACE_BEGIN pragma suddenly causes users' screens to explode with cryptic trace messages.

Is this actually creating a problem for you, or are we just having a theoretical discussion?

Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37142 23 Feb 24 05:46 PM
Joined: Nov 2006
Posts: 2,192
S
Stephen Funkhouser Online Content OP
Member
OP Online Content
Member
S
Joined: Nov 2006
Posts: 2,192
Just theoretical. I thought initially the PRIVATE_BEGIN/END was just not working because the documentation made it seem like they work the same as the trace.print.

We don't use trace.print for end-user feedback, so I was only thinking about development.

I can see your point. A documentation update would be good to remove this confusion.

Thanks

Last edited by Stephen Funkhouser; 23 Feb 24 05:47 PM.

Stephen Funkhouser
Diversified Data Solutions
Re: ++PRAGMA TRACE_BEGIN/TRACE_END bug [Re: Stephen Funkhouser] #37143 23 Feb 24 06:27 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
Ok good, we can agree on that. I'll work with Ty to correct the doc.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3