Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2014-02-04
09:05 • Closed ticket [971cb4f1db]: garbage strings in trace execution plus 6 other ... artifact: 741dadd017 user: dkf
08:50 • Ticket [971cb4f1db]: 4 changes artifact: 5ab9f99d88 user: dkf
08:46 • Ticket [971cb4f1db]: 6 changes artifact: 46447ca0a4 user: dkf
08:15
[971cb4f1db]: Make debugging traces less inclined to serious visual corruption check-in: 9533dbc4c7 user: dkf tags: trunk
2014-02-03
22:57 • Ticket [971cb4f1db] garbage strings in trace execution status still Open wit... artifact: 3e839ad3f7 user: dkf
18:53 • Ticket [971cb4f1db]: 5 changes artifact: df7a9547b6 user: miguel
18:52 • New ticket [971cb4f1db]. artifact: 2104c6b508 user: miguel

garbage strings in trace execution

Closed / Fixed971cb4f1db28882b1603700f0d8af60c6c1605a5Created 13 years agoUpdated 13 years ago
Descriptionplain2014-02-03 18:52:06
In order to repro: launch tclsh, [set tcl_traceExec 3], enter (empty command) => watch the output, some of the strings reported are obviously garbage
Referenced by1
  • 9533dbc4c7[971cb4f1db]: Make debugging traces less inclined to serious visual corruption check-in2014-02-04 08:15:52
miguelplain2014-02-03 18:53:07
assigning to dkf, hoping he sees immediately what's wrong
dkfhtml2014-02-03 22:57:11

It's the trim-set, which contains non-ASCII characters and which it seems that printf() doesn't do a good job of displaying. Not sure what to do about it, but it's really rather harmless.

dkfhtml2014-02-04 08:46:00

Such "garbage" as is there now is from TclPrintObject() rather than being injected by problems directly in printf(). I've only improved things in the tracing for the INST_STR_TRIM group of instructions because they're the only places where it is very likely to be a problem; elsewhere, problem characters are mostly rare.

I don't know if TclPrintObject() is doing the right thing, but it's what we use in other tricky cases (INST_PUSH for example).

dkfhtml2014-02-04 08:50:43

Any further fix belongs in PrintSourceToObj() in generic/tclCompile.c, which everything else is focussed through.

(Self note: this function moves to tclDisassemble.c on the dkf-improved-disassembler branch)

dkfhtml2014-02-04 09:05:06

Adjusted that function to be much less broken. (It assumed ASCII!) The result is that the reported case now produces code that can be much more easily understood.

Log in (anonymous is fine) to add a comment.