| 408 | } |
| 409 | |
| 410 | txString fxGetCodeName(txMachine* the, txByte* which) |
| 411 | { |
| 412 | if (which == gxNoCode) |
| 413 | return "(txByte*)(gxNoCode)"; |
| 414 | { |
| 415 | static char buffer[1024]; |
| 416 | txLinker* linker = xsGetContext(the); |
| 417 | txLinkerScript* linkerScript = linker->firstScript; |
| 418 | while (linkerScript) { |
| 419 | txS1* from = linkerScript->codeBuffer; |
| 420 | txS1* to = from + linkerScript->codeSize; |
| 421 | if ((from <= which) && (which < to)) { |
| 422 | sprintf(buffer, "(txByte*)(&gxCode%d[%ld])", linkerScript->scriptIndex, (long)(which - from)); |
| 423 | return buffer; |
| 424 | } |
| 425 | linkerScript = linkerScript->nextScript; |
| 426 | } |
| 427 | } |
| 428 | return "OOPS"; |
| 429 | } |
| 430 | |
| 431 | extern const txTypeDispatch gxTypeDispatches[]; |
| 432 | txInteger fxGetTypeDispatchIndex(txTypeDispatch* dispatch) |