Debug with GDB on a remote development machine

Source: Internet
Author: User
Due to some environmental constraints, many students may need to debug on the development machine, but due to the limitations of the development machine resources, the development machine directly on the local GDB environment configuration becomes a problem, this time in fact we can use the Gdbserver tool in GDB can be used to debug the remote development machine.

Gdbserver can walk the network, the serial port and other communication mechanisms, for the network support Ip:prot format operation. For example, your development machine is located in the IP is 192.168.3.11, your machine is 192.168.3.1, this time you first good GDB source code, and then into the Gdb_src/gdb/gdbserver directory./configure--host= Arm-linux-gnueabi,make,make Install, you use file to see if the current gdbserver is arm format, because eventually your gdbserver needs to run on the development machine, so it must be in arm format.

While your GDB is running on your machine, it is still in the x86 format, but his target is also shown to be set to arm, that is, under gdb_src/, configure--target=arm-linux-gnueabi,make,make Install, so you have completed the installation of GDB and Gdbserver.

After the development machine uploads the relevant gdbserver,./gdbserver 192.168.3.11:1234./test This opens the remote debugging interface for the development machine, which then enters the previously compiled GDB on the client and then enters the target remote 192.168.3.11:1234, that is, the completion of the development machine and your host docking, the next thing is the GDB debugging things

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.