Tornado API Reference : WTX Tcl Library
wtxtcl Library Part II [Tcl] - wtxtcl Library part II
wtxSymListGet - query the target server symbol table
wtxMemDisassemble - query the target server disassembled instructions
wtxLogging - WDB / WTX requests logging controls
wtxObjModuleLoad - Load a multiple section object file
wtxObjModuleLoadStart - Load a multiple section object file asynchronously
wtxObjModuleLoadProgressReport - get the asynchronous load status
wtxObjModuleLoadCancel - Stop an asynchronous load request
wtxAsyncNotifyEnable - Start the asynchronous event notification
wtxAsyncNotifyDisable - Stop the asynchronous event notification
wtxExecutableFind - WDB / WTX requests executable path via document name
wtxtcl APIs libary (part II)
wtxSymListGet - query the target server symbol table
WTX Tcl
wtxSymListGet [{-module nameOrId | -moduleId modId | \ -moduleName modName} [-unknown]] \ {-name name | -value value}
This function returns a list of symbols. If -name is specified, then name is interpreted as a regular expression; all symbols whose names match are returned. If -value is specified, then a set 12 symbols is returned, the first of whose address is not greater than the specified one. -module constrains the search to a particular module; -unknown returns only unresolved symbols for the module.
-module will be obsoleted in the next release.
A list of values, each of which is a symbol similar to those returned by wtxSymFind. It is not considered an error to submit a query that matches no symbols; an empty list is returned in that event.
tcl> wtxSymListGet -name "_sem.*Take$" {_semTake 0xce72 0x5 0 0 vxWorks} {_semBTake 0xce84 0x5 0 0 vxWorks} {_semOTake 0xcf4e 0x5 0 0 vxWorks} {_semCTake 0x4190e 0x5 0 0 vxWorks} {_semMTake 0x419d6 0x5 0 0 vxWorks}
- missing module name or ID
- The request cannot be satisfied without the object module name or ID.
- name and value options cannot be used together
- Use either name or value, not both.
- module and value options cannot be used together
- Use either module or value, not both.
- -unknown option cannot be used with name or value
- Don't use the -unknown option with name or value.
wtxtcl Library Part II, * WTX_SYM_LIST_GET, wtxtcl, wtxSymFind, wtxSymAdd, wtxSymRemove, wtxSymTblInfoGet
wtxMemDisassemble - query the target server disassembled instructions
WTX Tcl
wtxMemDisassemble [-address] [-opcodes] [-hex] startAddr \ [nInst [endAddr]]
This function returns a list of disassembled instructions starting from startAddr. A disassembled instruction has the following shape :
{<symbolName>} <instructionSize> {<instructionAddress>} {<instructionOpcodes>} {<disassembledInstruction>}If an instruction is disassembled at the adress of an existing symbol, then the demangled symbolName take the name of the demangled symbol name.The instructionSize field indicaes the instruction size in bytes to make it easy to retrieve following instruction's address.
The instructionAddress is the instruction memory address, or empty Tcl list element ({}) if the -address option is not set.
The instructionOpcodes value is set to the instruction's opcode vlue if the -opcodes option is set, else it is a Tcl empty list element.
The disassembleInstruction is the disassembled instruction properly, its layout depends on the board's architecture.
The -hex option allows to get disassembled instructions without the symbolic + opcodes sybol representation. Each address in the disassembled instruction field is represented by its real hexadecimal address
A list of disassembled instructions as described above.
wtxtcl> wtxMemDisassemble -address -opcodes 0x10d298 {_vxSemGive} 1 {0010d298} {55} {PUSH EBP} {} 2 {0010d299} {89 e5} {MOV EBP, ESP} {} 3 {0010d29b} {8b 45 08} {MOV EAX, [EBP+8] {} 1 {0010d29e} {50} {PUSH EAX} {} 5 {0010d29f} {e8 84 16 00 00} {CALL _semGive} {} 2 {0010d2a4} {89 ec} {MOV ESP, EBP} {} 1 {0010d2a6} {5d} {POP EBP} {} 1 {0010d2a7} {c3} {RET } {_vxSemTake} 1 {0010d2a8} {55} {PUSH EBP} {} 2 {0010d2a9} {89 e5} {MOV EBP, ESP} wtxtcl> wtxMemDisassemble -address -opcodes -hex 0x10d298 {_vxSemGive} 1 {0010d298} {55} {PUSH EBP} {} 2 {0010d299} {89 e5} {MOV EBP, ESP} {} 3 {0010d29b} {8b 45 08} {MOV EAX, [EBP+8]} {} 1 {0010d29e} {50} {PUSH EAX} {} 5 {0010d29f} {e8 84 16 00 00} {CALL 0x10e928} {} 2 {0010d2a4} {89 ec} {MOV ESP, EBP} {} 1 {0010d2a6} {5d} {POP EBP} {} 1 {0010d2a7} {c3} {RET } {_vxSemTake} 1 {0010d2a8} {55} {PUSH EBP} {} 2 {0010d2a9} {89 e5} {MOV EBP, ESP}
No error messages.
wtxtcl Library Part II, WTX_MEM_DISASSEMBLE, wtxtcl, wtxSymListGet
wtxLogging - WDB / WTX requests logging controls
wtxLogging wtx {on [filename] [maxSize] [regExp]| off} wtxLogging wdb {on [filename] [maxSize]| off} wtxLogging all off
Options available for the WTX log request are:
- ON
- Start the logging service
- OFF
- Stop the logging service
- filename
- Name where info will be written
- maxSize
- Maximum size of the log file
- regExp
- Regular expression used to filter events
Options available for the WDB log request are:
- ON
- Start the logging service
- OFF
- Stop the logging service
- filename
- Name where info will be written
- maxSize
- Maximum size of the log file
Start the WTX logging with a file never bigger than 10000 bytes and containing all WTX requests except "WTX_TOOL_ATTACH".
tcl> wtxLogging WTX ON /folk/pascal/wtx.txt 10000 WTX_TOOL_ATTACHStart the WTX logging without size limit and with a default WTX requests filter.tcl> wtxLogging WTX ON /folk/pascal/wtx.txt WTX_LOG_NO_LIMITStop the WTX and the WDB logging in one call.tcl> wtxLogging ALL OFF
TCL_OK if success otherwise TCL_ERROR
No error messages.
wtxtcl Library Part II, WTX_COMMAND_SEND, wtxtcl
wtxObjModuleLoad - Load a multiple section object file
wtxObjModuleLoad [-ts] [flags] [textAddr] [dataAddr] [bssAddr] filename
This routine loads a module onto the target and into the target server module table. It returns when the module is in the target server memory, ready to be relocated and downloaded by the target server loader.
Files loaded on the target by the target server can be opened either by the target server or by the client. These two behaviors can be controled by the [-ts] option: if set, then opens the file where the target server is; otherwise the file is open locally where the client is.
Flags is one or more members of the LOAD_FLAG values; see the entry for WTX_OBJ_MODULE_LOAD in the .I "API Reference Manual: WTX Protocol". If the module sections are to be loaded at particular addresses, these can be specified in hexadecimal for the textAddr, dataAddr, and bssAddr.
The ID of the newly loaded module, followed by the text, data, and bss addresses of the module sections. If there are symbols in the module that cannot be resolved against other modules on the target, a list of these is appended to the result.
tcl> wtxObjModuleLoad /folk/pascal/test.o tcl> wtxObjModuleLoad LOAD_LOCAL_SYMBOLS /folk/pascal/test.o
The address parameters are likely to change syntax. The interface and result must be able to deal with named sections and more than three sections.
No error messages.
wtxtcl Library Part II, WTX_OBJ_MODULE_LOAD_2, wtxObjModuleList, wtxObjModuleInfoGet, wtxObjModuleFind, wtxObjModuleUnload, wtxObjModuleByNameUnload, wtxObjModuleLoadStart, wtxObjModuleLoadProgressReport, wtxObjModuleLoadCancel
wtxObjModuleLoadStart - Load a multiple section object file asynchronously
wtxObjModuleLoadStart [-ts] [flags] [textAddr] [dataAddr] [bssAddr] filename
This routine loads a module onto the target and into the target server module table. It returns when the module is in the target server memory, ready to be relocated and downloaded by the target server loader.
Because this routine returns only TCL_OK or TCL_ERROR, the user must call wtxObjModuleLoadProgressReport in order to have the module Id, sections addresses and the undefined symbols.
TCL_OK or TCL_ERROR if something failed.
Load a module on the target, the file is opened by the client and get its module Id by a wtxObjModuleLoadProgressReport request.
tcl> wtxObjModuleLoadStart /folk/pascal/Board/ads860/objSampleWtxtclTest2.o tcl> wtxObjModuleLoadProgressReport tcl> 0xfec270 0x6c810 0xffffffff 0xffffffff
No error messages
wtxtcl Library Part II, WTX_OBJ_MODULE_LOAD_2, wtxObjModuleLoad, wtxObjModuleLoadProgressReport, wtxObjModuleLoadCancel
wtxObjModuleLoadProgressReport - get the asynchronous load status
wtxObjModuleLoadProgressReport
This routine returns the current load context after a wtxObjModuleLoadStart request.
Load a module on the target and its load status is evaluated.
tcl> wtxObjModuleLoadStart /vobs/wpwr/target/lib/objMC68020gnutest/big.o tcl> wtxObjModuleLoadProgressReport 1 0 0 tcl> wtxObjModuleLoadProgressReport 3 90092 45276 tcl> wtxObjModuleLoadProgressReport 0xfec008 0x71640 0xffffffff 0xffffffff tcl> wtxObjModuleLoadProgressReport WTX Error 0x10007 (SVR_EINVAL)
If the load is in progress, then status is returned in a 3 values list:
x y z, where x is the load state; y and z are the max value for this
state and the current value. x can take 3 values:
LOAD_PENDING (0), LOAD_INITIALIZED (1), LOAD_DOWNLOADING (3)>
y and z are relevant only with LOAD_DOWNLOADING state. If the load is done, the ID of the newly loaded module is returned, followed by the text, data, and bss addresses of the module sections. If there are symbols in the module that cannot be resolved against other modules on the target, a list of these is appended to the result.
No error messages.
wtxtcl Library Part II, WTX_OBJ_MODULE_LOAD_2, wtxObjModuleLoadStart( ), wtxObjModuleLoad( ), wtxObjModuleLoadCancel( )
wtxObjModuleLoadCancel - Stop an asynchronous load request
wtxObjModuleLoadCancel
This routine stops an asynchronous load request. If the load had been already done or it can't be found, then it returns an error.
TCL_OK or TCL_ERROR on error.
No error messages.
wtxtcl Library Part II, WTX_COMMAND_SEND, wtxObjModuleLoadStart, wtxObjModuleLoadProgressReport
wtxAsyncNotifyEnable - Start the asynchronous event notification
wtxAsyncNotifyEnable userDefinedTclHookRoutine
This function creates a socket-based link between the target server and the client.
In conjunction with wtxAsyncNotifyEnable, wtxRegisterForEvent (or wtxUnregisterForEvent) must be used to specify which type of events must be sent to the requester.
When this service is started, all requests wtxEventGet or wtxEventListGet will return an empty result because when an event is coming in the target server, it is staightaway sent to the client and not store in the target server event list. So, an wtxEventGet request will find an empty list.
When an event is coming to the client, the event is put in a list in the same ouput format as wtxEventGet: {eventstring [mblk]}.
All strings contained in the EVENT_DESC structure must be copied before to be used because their life duration is depending on the events stream.
TCL_OK or TCL_ERROR if something failed.
No error messages.
wtxtcl Library Part II, wtxAsyncNotifyDisable
wtxAsyncNotifyDisable - Stop the asynchronous event notification
wtxAsyncNotifyDisable
his function sends to the target server an order to stop the asynchronous notification of events.
TCL_OK or TCL_ERROR if something failed.
No error messages.
wtxtcl Library Part II, wtxAsyncNotifyEnable
wtxExecutableFind - WDB / WTX requests executable path via document name
WTX Tcl
wtxExecutableFind filename
This function returns a pathname for the executable associated with open Windows shell acction on a given type of document. File with filename must exist and have a registered Windows extension (e.g. .html, .doc, .bmp etc) Function works on Win32 only and returns TCL_ERROR if called on Unix.
Input filename can contain \ or / characters as directory seprators in pathname. When wtxExecutableFind returns, returned pathname has forward slashes "/" and may contain spaces. In recent versions of Win32 cannot be longer than 260 bytes and short-name equivavalent is returned. The result may contain the path to the DDE server or DLL.
Full blown Win32 pathname starting with drive letter or pathname in UNC form or [possibly] path to DDE server.
tcl> wtxExecutableFind c:/MyTestDocumentThatDoesExist.htm C:\Program Files\Microsoft Internet\Iexplore.exe
- no association
- There is no association for the specified file type.
- file not found
- The specified file was not found.
- path not found
- The specified path was not found.
- exe file is invalid
- The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
- out of memory
- System is low on or out of memory.
- unknown error
- System returned unexpected error.
- not implemented
- Not implemented for this platform.
wtxtcl Library Part II, * wtxtcl