VxWorks symbol table and vxworks symbol table

Source: Internet
Author: User

VxWorks symbol table and vxworks symbol table
Symbol table Initialization

The symbol table is used to establish the relationship between symbol names, types, and values. It is an arbitrary string ending with null. Its type is an integer that identifies various symbols. Its value is a character pointer. Symbol tables are mainly used as the basis for loading the target module, but they can be used whenever names and values need to be associated. The operating system usually has two symbol table structures: sysSymTbl and statSymTbl. SysSymTbl is the system symbol table of the target machine. the symbols of the symbol module of the target module dynamically loaded by the program or tShell are added to the symbol table, the sysSymTbl and statSymTbl tabs are contained in the system symbol table. StatSymTbl contains errno information. If you use the printErrno command in tShell, the table must contain this symbol. The Target Server of the host uses only one symbol table. The global variable tgtSymTbl is used for access. In vxWorks, the symbol table function library symLib provides functions related to symbol table operations. The system symbol table allows conflict of the same name. If a symbol of the same name is added back to the symbol table, no error is reported. When a symbol is referenced, the system uses symFindByName by default. Therefore, the newly added symbol is always found first, replace the old symbol to complete the reference. The existence of symbols with the same name poses another problem. You cannot ensure that the searched symbols are loaded by yourself, that is, the group number cannot be guaranteed. The functions in the host symlib library are used to maintain the host symbol table tgtSymTbl. The symbol table of vxWorks is the same as the symbol table of the compiler. the symbol table of vxWorks dynamically exists in the system and is maintained by the functions provided by symLib. During running, symbols can be added and deleted, it is mainly used for dynamic loading of the target module and has nothing to do with the format of the target module. The symbol table in the compiler is static. It is generated and used by the compiler and connector when a program image is created. It is mainly used for static parsing of symbols to help build an image, their format is related to the target type. Source code debugging in the Cross-debugger. pages are supported by static symbol tables, which occupy a large space for program image. When a program is released, can be removed (the-g option is not used ). Token, used to generate a symbol array to compile and enter the program image. The tool makesymtbl.exe is used to create symTbl that contains the SYMBOL array. the c file contains the names, addresses, and types of all global symbols in the target module. The global array name is standTbl and its size is standTblSize, which is stored in the data segment of the program image. The makestattbl.exe tool is used to create a SYMBOL array of Status Code, which contains the names and values of all status codes defined in some header files. All status codes start with "S, this is usually the definition in the header file of the library ., The global array name becomes statTbl, and its size is statTblSize. statSymTbl is mainly used by the printErrno function, and can also be used by applications to output status information of the specific meaning, stored in the data segment of the program image. The initial mode of the symbol table is build-in and downloaded. When the built-in symbol table is used, part of the Vxworks program image is used. When the downloaded symbol table is separated from the VxWorks image, the Sym file is downloaded from the target machine to obtain the symbol. If you use the download symbol table, use the host tool xsym to generate the symbol module File VxWorks. sym. The file is the same as the common target module, but it does not have data and bss segments. After being downloaded to the target machine, it is dynamically loaded as the common target module, the symbols in the module are added to the system symbol table. The auxiliary mechanism for dynamic loading, connection, and debugging of the target symbol table does not affect the normal running of the program, as long as the target module is not dynamically loaded from the target machine, the program image symbols are statically connected for parsing, and there can be no symbols on the target machine. The host development tools use the host symbol table tgtSymTbl for cross debugging.


Symbol table Synchronization

The host and the target machine use different symbol tables. The tools used on the host cannot access all the content on the target machine, tools communicate with the Target Agent on the Target Server and the Target machine. Both the host and the Target machine cannot directly access the symbol information of the Target machine. Both the host and the target host maintain their own symbol tables. When adding symbols, add the symbols to one of the tables and add the symbols on the wShell to the host symbol table, the symbols added on tShell are in the destination symbol table. The two tables do not share each other due to lack of time. You can add the symbol table synchronization component ------ INCLUDE_SYM_TBL_SYNC, in this way, the symbols will benefit between the host and the target machine, and the two symbol tables will be updated at the same time. The host and target hosts use different symbol tables. When the system starts, the two symbol tables have the same content. When the target module is dynamically loaded, the two symbol tables are inconsistent, after loading the target module from wShell, you want to reference the module symbol from tShell or use the host tool to debug the module after loading the module from tShell, because neither wShell nor tShell can see the module loaded by the other party, the following Error may occur: Error: module contains undefined symbol Unresolved symbol Fatal Error: to solve this problem, unresolvable symbol needs to use the symbol table synchronization mechanism. Vxworks provides the symSyncLib library to synchronize symbol tables. The system is running, the symbols added from the host or Target machine can be seen by the other party. symSyncLib creates a synchronization task tSymSyc on the Target machine, which is used as a WTX tool to connect to the Target Server of the host, when the task is started, the symbol table is synchronized immediately. If you no longer need to synchronize the symbol table, you can manually pause tSymSync to improve the performance of the target machine.


Error status

If there is a problem with function execution in the VxWorks library, the function returns the ERROR value and sets the ERROR status to indicate the specific cause and location. The error status library errnoLib is used to obtain and set the error status value errno for tasks and interruptions. In VxWorks, each task and interruption has its own errno. The errno of the task is stored in TCB and is private to the task, the interrupted errno is stored in the interrupt stack. As long as the word is used, errno is valid in the interrupt processing function. The errno value of VxWorks is composed of 4 bytes. The high text indicates the database where an error occurs. The corresponding values of each database are "taget/h/vwModNum. h ", which indicates a specific error occurred in the database. It is defined in the header file of the corresponding database. It is agreed that the VxWorks system module should use a high value, ranging from 1 ~ 500. Other values can be used by the application module. There is no rule for low-word values. UsrLib provides the printErrno function to display specific error information. printErrno finds the corresponding error information in statSymTbl based on the input errno value and displays it in the standard output. ----> PrintErrno 0xd0003 0xd0003 = S_iosLib_INVALID_FILE_DESCRIPTOR "S _" indicates the status, iosLib indicates the name of the database in which an error occurs, and INVALID_FILE_DESCRIPTOR indicates the specific error of the database. If you want to call printErrno in a tShell or program to display the error message, the program image must contain the error code component ---INCLUDE_STAT_SYM_TBLTo create statSymTbl on the target machine. 'If you cannot use printErrno, you can also manually find the header file to get the error message, such as "d0003", first in vwModNum. h. Find the library corresponding to "d", convert "d" to "13" in decimal format, find M_iosLib: # define M_iosLib (13 <16), and then go to the iosLib library's own header file iosLib. h. The macro corresponding to "0003" is defined as: # define S_iosLib_INVALID_FILE_DESCRIPTOR (M_iosLIb | 3). This macro definition name is the error information you need to know.

Vxworks target Screen Copy

Vxworks user manual 3 (transfer)
Added serf To the embedded system Forum on

5. Procedure
To use the Tornado integration environment, follow these steps:
Run the TCP/IP Port Manager portmapper(portmap.exe)
Run the Registrar Tornado Registry(wtxregd.exe ). If you are using a trial version, check whether the registration is successful and whether the date has been modified.
Run and Configure Ftp Server(wtfpd32.exe ). Click the menu command Security | Users | rights to bring up the Configuration window, click New User, and add the username to be added in the New User pop-up window (note: consistent with the bootrom or boot floppy disk settings of the target machine), set the user's password in the Change Password pop-up window (Note: it must be consistent with the bootrom or boot floppy disk settings of the target machine ), in the Home Directory, set MCP750 to c: \ tornado \ target \ config \ mcp750, MCPN750 to c: \ tornado \ target \ config \ mcpn750, and X86 to c: \ tornado \ target \ config \ pc.pdf. The configuration is complete.
Target board power supply or reset
The supervisor can view the startup information on the console (MCP750/MCPN750 is a Super Terminal and X86 is the target machine display. If you need to modify it, press the c key to modify it while waiting for user configuration. (Note: The configuration information must be consistent with the host configuration and Ftp server configuration.) after the modification, Press @ to restart the target machine.
Run tornado(tornado.exe)
Execute the menu command Tools | Target Server | Configure. The Target Server Setting dialog box is displayed. Click New to generate a New configuration. Set the Description domain (which can be set at Will); set the Target Server domain (which can be set at Will); select the Back End item in the Change Property domain (this item sets how the host and the Target machine are connected, the default value is network port connection. If you use serial port connection, you need to modify configall. h file, re-compile the link VxWorks image). If you use the network port for debugging, select wdbrpc and provide the IP address or address of the target machine in the target IP name or address field (we recommend that you give the IP name, this is much faster). If the IP name is given, you need to give the ing between the IP name and the IP address in the HOSTS file. If you use serial port debugging, select wdbserial, select the corresponding serial port and baud rate (note: the serial port here means that the serial port of the host is not the serial port of the target machine); select the Core File and Symbols item in the Change Property field, select File and enter the corresponding File (MCP750c: \ tornado \ target \ config \ mcp750 \ vxWorks, MCPN750 is c: \ tornado \ target \ config \ mcpn750 \ vxWorks and c: \ tornado \ target \ config \ pc1_\ vxWorks on the X86 Platform). Click Launch to run the target server.
Execute the menu command File | New to create a New File and open the Editor (this Editor is not very powerful, you can use other editors such as Source Insight ).
Compile the source file generated separately, generate the target file (. o), and compile the connection process... the remaining full text>
 
Real-time debugging of Vxworks networks?

Summary of common Debugging commands for vxworks, learning such things as vxworks is necessary. 1. task-related commands sp, [arg1],..., [arg9]-start a task. A maximum of nine parameters are allowed. The default priority is 100, and the stack is 20000 bytes period n, [arg1],..., [arg8]-create a periodic call task with a cycle of n seconds. A maximum of 8 repeat m, [arg1],..., [arg8]-create a task that is called repeatedly. The call count is m. If m = 0, the task is called permanently, up to 8 parameters are also ts tidX-pending task tr tidX-resume pending task td tidX-delete task I tidX-display basic task information, when the parameter is 0, all tasks are displayed. tidX-display task details, including registers, stacks, and other tt tidX-display the function call relationship of the task. checkStack tidX-display historical statistics on the use of the task stack, when the parameter is 0, all tasks are displayed. [tidX can be a task ID or a task name.] 2. System Information: lkup ["string"]-in the system symbol table, locate and list tasks that contain" string "character functions and global variables, there are two special parameters: 0, indicating the symbol table statistics; "" (Null String), listing all the symbols lkAddr addr-displaying the symbol table near the addr address l addr, [n]-display the disassembly of n commands starting from the addr address. When n is omitted, the default value is 10 commands h [n]-When n is 0, the latest shell commands are listed, the default value is 20. If n is not 0, set the number of historical commands recorded by the shell. d [addr, [number], [width]-displays the content of the number units starting with the addr address. width customizes the width of each unit, which can be 1, 2, 4, 8 m addr, [width]-change the content of the addr address according to the width, width can be 1, 2, 4, 8 memShow 1-display the total number of idle and allocated space on the system partition and other printErrno value-print the macro of the system-defined error code 3. Network-related command ifShow ["ifname"]-show info about network interfaces inetstatShow-show all Internet protocol sockets tcpstatShow-show statistics for TCP udpstatShow-show statistics for UDP ipstatShow-show statistics for IP icmpstatShow -show statistics for ICMP arpShow-show a list of known ARP entries mbufShow-show network stack data pool statistics netStackSysPoolShow-show network stack system pool statistics routeShow-display all IP routes (summary information) mRouteShow-display all IP routes (verbose information) routestatShow-display routing statistics routeAdd "destaddr", "mongoaddr "...... remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.