VELT-0.1.5 Development: Interrupt MinGW GDB execution

Source: Internet
Author: User

Veltthe full name isVisual Embedlinuxtools, it is aVisual GdBsimilar toVisual Studioplug-in to assist with the completionLinuxdevelopment. Using this plugin, you will be able toVisual Studioof theIDEconducted inLinuxthe development of the application (including compilation and debugging) can also beUbootand theLinuxthe kernel compiles and correctly locates the source code according to the error information at compile time. The current version is0.1.4, only supportvs2013. This plug-in can beCSDNDownload Channel Download (http://download.csdn.net/detail/lights_joy/8429771), the installation process is described in theEmbedded development with vs2013+velt-0.1.4 : Plug-in installation ". Here are the basic features:

  1. support x86 Linux , HiSilicon hi3516/hi3520 , mingw These several platforms provide project templates for these platforms.

  2. complete uboot compilation, and automatically navigates to the appropriate file location based on the compiled error message.

  3. complete linux kernel compilation, and automatically navigates to the appropriate file location based on the compiled error message.

  4. vs complete linux kernel configuration.

  5. Span lang= "en-US" >makefile linux compilation of the application.

  6. using makefile linux development of the application.

  7. using ssh connect the target machine and Span lang= "en-US" >gdb debug the application.

  8. Use Telnet connect the target machine and use gdb for debugging of the application.

  9. in theVSintegrated inLinuxTerminal(Poderosa), Supportssh/telnet/comautomatically when you open the terminal.VSthe variables are exported asBashvariables, such asProjectDirand so on.

This article discusses how to break the execution of a mingw gdb when it is called.



whenMingw GDBWhen you load the program and run it, you need to receivectrl-cinterrupts the program's operation and enters the debug state. In the previous scenario, the direct use of thegenerateconsolectrleventsend this event on the go. However, this method fails after the debug scenario is modified becausegenerateconsolectrleventone of the conditions that needs to be met is that the caller must haveConsole, but in the modified scenario, the debug engine is lowered directlygdb, while the debug engine is notConsolethe!

look up the information, it seems to need to use Remotethread , but this method is too complex.

in fact, according to generateconsolectrlevent the reason for the failure is very easy to think of, just think of ways to call this function before it thinks the caller has Console you can do it:


        Import in the declaration for Generateconsolectrlevent [DllImport ("kernel32.dll", SetLastError = True)]        static extern bool Generateconsolectrlevent (consolectrlevent sigevent, int dwprocessgroupid);            public enum Consolectrlevent {ctrl_c = 0, Ctrl_break = 1, Ctrl_close = 2,        Ctrl_logoff = 5, Ctrl_shutdown = 6} [DllImport ("kernel32.dll", SetLastError = True)]        static extern bool Attachconsole (UINT dwprocessgroupid);        [DllImport ("kernel32.dll", SetLastError = True)] static extern bool Freeconsole ();            <summary>///Send Ctrl-c//</summary> override public void break () { if (! Attachconsole (UINT) _process.            ID)) return; if (! Generateconsolectrlevent (Consolectrlevent.ctrl_c, _process.            ID)) return; if (!        Freeconsole ()) return; }

Here's _process is created in the engine. Cmd.exe process.

first use attatchconsole Connect, then call generateconsolectrlevent Span style= "font-family: Song body; Mso-ascii-font-family:calibri; Mso-hansi-font-family:calibri; " > send ctrl-c > There's no problem.

finally remember Freeconsole !









??

VELT-0.1.5 Development: Interrupt MinGW GDB execution

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.