How to set breakpoints for programs with Tau G2 in VxWorks

Source: Internet
Author: User

The simulation function of the Tau G2 program itself is very powerful. If a logic error occurs when the program runs on the target machine, you can always simulate this error in the simulation environment of Tau G2 and find the cause of the error, generally, you do not need to use the C code debugging tool of the operating system. However, if a C-language function is called in Tau G2 or an error occurs in the environment function, the problem becomes complicated because the simulation environment of Tau G2 cannot track the C-language code, you can only use the debugging functions of the operating system.

The program generated by Tau G2 has at least two threads: one is the main thread, that is, the thread where the main function is located. For example, xinitenv and xinenv in the environment function are both in the main thread, it is easy to set breakpoints for the main thread. After the debugger is started, use toggle breakpoint (F9) in the Debug menu, because the debugger treats the main thread as the current thread by default; another thread is the thread where the UML code is located. Generally, you do not need to set breakpoints in the generated UML code, but xoutenv is in this thread, if the C-language functions are called in the UML code, these C-language functions are also in this thread, in this thread, if you still use F9 to directly set the breakpoint, the program will often not stop but continue to execute.

To set a breakpoint for debugging in xoutenv or a self-compiled C function, you can use toggle Global breakpoint (shift F9) in the Debug menu to set a Global breakpoint. After a Global breakpoint is set, when the thread where the UML code is located executes at the breakpoint, the thread stops. In this case, you can use the attach function in the Debug menu, change the current thread from the main thread to the UML thread, so that you can track debugging in a single step. The UML thread is usually the last thread in the attach dialog box. Its name is T1 by default, but sometimes the thread name is garbled.

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.