VELT-0.1.3 Development: MinGW a strange question for gdb

Source: Internet
Author: User

Happy Shrimp

http://blog.csdn.net/lights_joy/(QQ group: Visual embedlinux Tools 375515651)

Welcome reprint, but please keep the author information


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.2, only supportvs2013, is a plug-in that has just started developing soon. Can be inCSDNDownload Channel Download (http://download.csdn.net/detail/lights_joy/8359251), the installation process is described in the Linux development with vs2013+velt-0.1.0 : Environment building ". Here are the basic features:

  1. support x86 Linux , hi3516 , hi3520 , mingw These are the few 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. complete linux kernel configuration.

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

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

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


using mingw gdb There was a puzzling question.

When debugging the following simple program, when pressing the ctrl-c when the program is interrupted, it causes the program to exit unexpectedly.


int main (int argc, char* argv[]) {printf ("I m here!\n"); GetChar (); return 0;}

Here is the debug record:



According to our expectations, when pressing thectrl-c, at this timegdbThe program should be parked inGetCharfunction, you can see the stack and thread information, but actuallyctrl-cdirectly lead to the end of the program, it feels likegdbwill bectrl-cas a character to feed theGetChar, and then the application ends directly.

To verify, change the program to:

int main (int argc, char* argv[]) {printf ("I ' M here!\n"), int c = GetChar ();p rintf ("GetChar returns%d\n", c); while (true) Sle EP (+); return 0;}


this time I can see clearly,ctrl-cIn addition to lettinggdbThe interruption of procedures and execution also resulted inGetCharfunction exits, but the strange thing is that at this pointGetCharThe resulting value is-1, but notctrl-cthe value0x3!







??

VELT-0.1.3 Development: MinGW a strange question for gdb

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.