|
2011-04-12
| ||
| 09:39 | • Ticket [3059758fff] tclTraceExec==3 : wrong pc+INST on uncaught error return... artifact: 53e9128332 user: msofer | |
|
2010-09-20
| ||
| 04:03 | • Ticket [3059758fff]: 4 changes artifact: e54c759dbb user: ferrieux | |
| 04:03 | • Add attachment traceinst.patch to ticket [3059758fff] artifact: d145c4cb2d user: ferrieux | |
| 04:02 | • Ticket [3059758fff] tclTraceExec==3 : wrong pc+INST on uncaught error return... artifact: 35f45e3246 user: ferrieux | |
| 03:55 | • Ticket [3059758fff]: 4 changes artifact: eaefc19192 user: ferrieux | |
| 03:55 | • Add attachment out.txt to ticket [3059758fff] artifact: d7a4bceab8 user: ferrieux | |
| 03:54 | • Ticket [3059758fff] tclTraceExec==3 : wrong pc+INST on uncaught error return... artifact: 499f56240f user: ferrieux | |
| 03:54 | • Add attachment traceexec.tcl to ticket [3059758fff] artifact: 88879322b6 user: ferrieux | |
| 03:53 | • Ticket [3059758fff] tclTraceExec==3 : wrong pc+INST on uncaught error return... artifact: dd3ff852ac user: ferrieux | |
|
2010-09-06
| ||
| 06:10 | • Ticket [3059758fff]: 4 changes artifact: e748092d6b user: ferrieux | |
|
2010-09-05
| ||
| 10:14 | • New ticket [3059758fff]. artifact: 7180fbcacd user: ferrieux | |
tclTraceExec==3 : wrong pc+INST on uncaught error return
Open3059758fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 16 years ago
Descriptionplain2010-09-05 10:14:14
When tracing instructions (tclTraceExec==3), returns from procedure calls typically look like:
... no enclosing catch, returning TCL_OK
LEVEL: DEPTH (PC) INST args => ... after "PROCNAME": TCL_OK, result="1"
where PC and INST/args are the position and instruction to be executed just after the return.
However, when the return code is not TCL_OK, the PC is off by one, and is the last byte of the previous instruction (typically invokeXXX), and consequently the INST is random (possibly an immediate operand interpreted as an opcode):
... no enclosing catch, returning TCL_ERROR
LEVEL: DEPTH (WRONG PC) WRONG INST => TCL_ERROR, result= "..."
Of course this is a very tiny issue, but tracing instructions accurately is key to understanding the delicate operation of TEBC, and this microbug has been annoying in the course of the investigation of Patch 2995655. The fix/insight could help both.
ferrieuxplain2010-09-06 06:10:48
The 'pc--' after the nonRecursiveCallReturn: label is the reason. I know it is necessary, so that the pc goes back into the range of the offending instruction, so that TIP 280 info can be recomputed from it, but subsequently a stronger contract is expected: namely that *pc be the inst itself:
processExceptionReturn:
#if TCL_COMPILE_DEBUG
switch (*pc) {
...
So, the conflict must be resolved, either by giving up the pretty printing of the offending inst, or by using the pc-indexing data in TIP 280 to crawl back to the beginning of the inst (conditionally on TCL_COMPILE_DEBUG).
ferrieuxplain2010-09-20 03:53:55
Attaching example: traccexec.tcl, and generated output, out.txt.
The following line from the output has an invalid pc and instruction:
1: 3 (7) pop => TCL_ERROR, result= "Yo"
since offset 7 is not the beginning of an instruction:
Command 1: "B x x"
(0) push1 0 # "B"
(2) push1 1 # "x"
(4) push1 1 # "x"
(6) invokeStk1 3
(8) done
ferrieuxplain2010-09-20 03:54:39
File Added - 387181: traceexec.tcl
ferrieuxplain2010-09-20 03:55:15
File Added - 387182: out.txt
ferrieuxplain2010-09-20 04:02:28
Attaching a patch that at least brings back a valid pc and inst, though it is the instruction _following_ the one which is erroring. Though it is not entirely acceptable for the current purpose, this patch uses a new local in TEBC, pcBeg, that is also needed for 2995655. Miguel, please review :}
ferrieuxplain2010-09-20 04:03:25
File Added - 387183: traceinst.patch
msofer Ticket [3059758fff]: 1 change
[History diff]2011-04-12 09:39:24
Log in (anonymous is fine) to add a comment.
Attachments:
- traceinst.patch [download] added by ferrieux on 2010-09-20 04:03:24. [details]
- out.txt [download] added by ferrieux on 2010-09-20 03:55:15. [details]
- traceexec.tcl [download] added by ferrieux on 2010-09-20 03:54:39. [details]