Re: Tcl bug?





Donald Arseneau wrote:
Ken Tilton <kentilton@xxxxxxxxx> writes:


proc TraceOP {n1 n2 op} {event generate $n1 <<tracewrite>> -data {$n1 $op}}
trace add variable .f44.ent45 write TraceOP


Error: Tcl error: can't read ".f44.ent45": no such variable


Don't use braces for -data! You are preventing $n1 $op from
being substituted in the context of TraceOP.

Really? I thought I saw that working. maybe not since the last upheaval. Thx.


proc TraceOP {n1 n2 op} {event generate $n1 <<tracewrite>> -data [list $n1 $op]}

By the way, you can get really misleading error messages from
traces. The error message and the error context (errot_info)
don't seem to correspond.

What happened was that the event handler that picked up the <<tracewrite>> event was curious about the new value so it did:

Tcl_Eval("set .f44.ent55")

I guess since the trace command had triggered the callback, a procedure was running and so the scope was local. Game over. :)

I simply have not finished the transition from pipespeak to using the C api, or I would have found Tcl_GetVar sooner, along with the flags i could use to make the scope global.

thx for the info.

kt

--
Cells: http://common-lisp.net/project/cells/

"Have you ever been in a relationship?"
Attorney for Mary Winkler, confessed killer of her
minister husband, when asked if the couple had
marital problems.
.



Relevant Pages

  • Re: Tcl bug?
    ... trace add variable .f44.ent45 write TraceOP ... being substituted in the context of TraceOP. ... you can get really misleading error messages from ... The error message and the error context ...
    (comp.lang.tcl)
  • RE: Base EDI adapter: COM_SendMessage eternal loop error
    ... need a newer version of the Base EDI Adapter. ... still get the EDI Subsystem error messages. ... | Very best regards, ... | ""Trace Young"" wrote: ...
    (microsoft.public.biztalk.general)
  • Re: [patch 04/18] x86, bts: wait until traced task has been scheduled out
    ... If the traced task is running, the cpu might still ... trace that task after the branch trace control bits have cleared. ... Wait until the traced task has been scheduled out before ... A similar problem affects the task debug store context. ...
    (Linux-Kernel)
  • Re: [PATCH 2/2] tracing/events/lockdep: move tracepoints within recursive protection
    ... it allows one event to trace within another event. ... But surely not in the same context. ... You could do a 4 level recursion ... Why not allow a nested interrupt to trace? ...
    (Linux-Kernel)
  • Re: Mass and strong interaction.
    ... > In this context, it's of interest to note that for the Leptons, the ... > trace Trof the mass matrix M_L is, to a high degree of accuracy, ...
    (sci.physics.research)

Loading