分享

【vxworks笔记】vxworks调试常用命令

 WUCANADA 2012-09-15
【vxworks笔记】vxworks调试常用命令
ahong007 发表于 - 2010-1-15 3:17:00
11

总结的vxworks常用调试命令,学习vxworks这些东西是必须的。

1.与任务相关的命令
sp ,[arg1],...,[arg9]
-启动任务,最多接受9个参数,默认的优先级100、堆栈20000字节

period n,,[arg1],...,[arg8]
-创建一个周期调用的任务,周期为n秒,最多接受8个参数

repeat m,,[arg1],...,[arg8]
-创建一个反复调用的任务,调用次数为m,m=0时永久调用,最多也是8个参数

ts tidX         -挂起任务
tr tidX         -恢复挂起的任务
td tidX         -删除任务
i   tidX         -显示任务基本信息,参数为0时显示全部任务
ti tidX         -显示任务详细信息,包括寄存器、堆栈等
tt tidX         -显示任务的函数调用关系
checkStack tidX -显示任务堆栈使用的历史统计,参数为0时显示全部任务
[其中tidX可以为任务ID 也可以为任务名]

2、系统信息

lkup ["string"] -在系统符号表中查找并列出含有"string"字符的函数及全局变量,有两个特殊参数:
                   0,给出符号表统计;""(空字符串),列出全部符号

lkAddr addr      -显示addr地址附近的符号表

l addr,[n]       -显示addr地址开始的n条指令的反汇编,n省略时默认为10条指令

h [n]            -n为0时列出最近执行的shell命令,默认20条;n非0时,设定shell记录的历史命令的数目

d [addr,[number],[width]]
                 -显示addr地址开始的number个单元的内容,width定制每个单元的宽度,可以是1、2、4、8

m addr,[width]   -按width宽度修改addr地址的内容,width可以是1、2、4、8

memShow 1        -显示系统分区上空闲和已分配空间的总数等

printErrno value -打印系统定义的错误码的宏

3、与网络相关的命令

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","gateaddr" - add route to route table
routeDelete "destaddr","gateaddr" - delete route from route table

说明:上述大多数命令都可以在help、netHelp中查到


The VxWorks shell

Useful control chars for all targets:

    ^S, ^Q are good for debugging

    ^H, ^U backspaces and delete line control

    ESC to put in vi edit mode. see section 11.5 of VxWORKS programmer's manual for vi edit command summary

Shell syntax:

    Can interpret "C-like" expressions. " ;" will separate command execution from the VxWORKS shell context. It is used to resolve ambiguity between commands.

  • Any symbol stored in the symbol table can be referenced. ex: printf, fopen, logMsg, or global variables. When calling functions, the shell ignores the "()" braces, so you may omit them.

  • Data Types -- strong type-casting recommended or else:
    • L.H. type = R.H. type
    • mixing floats and ints will result in a double
    • doubles always assumed unless explicit type-casting is performed
    • allocating char-strings done by:

      ->
      -> ss = "bla bla bla"
      ->

    • explicit address referencing: eg,

      ->
      -> *0x1100 = 10;
      ->

  • Unlike C, Array references require an explicit application of the "&" operator. Array declarations in the shell should be avoided if at all possible.

Shell Redirection:

  • copy < input_file > output_file

  • Be careful of using "<" or ">". For example:

    ->
    -> x > y
    ->

    will print the value of x out to a stream named "y", while

    ->
    -> x > y;
    ->

    will be interpreted as "x is greater than y" !

  • script files can be used to spawn tasks, set variables, etc.:

    ->
    -> < script-file
    ->

    will invoke the commands contained within file named, script-file.

  • You can quickly create script files by redirecting the history listing shell command to the output and then stripping the numbers off:

    ->
    -> h > host:/tmp/script
    ->

    Then from the UNIX host, you do the following to strip the numbers off:

    simbox%
    simbox% colrm 1 5 < /tmp/script > /tmp/newscript
    simbox%

    • 本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
      转藏 分享 献花(0

      0条评论

      发表

      请遵守用户 评论公约

      类似文章 更多