Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs     - Let the router be your security barrier against external attack (Linux)

- CentOS 6.5 installation and configuration Cobbler (Server)

- MySQL Tutorial: Some optimized for I / O memory areas (Database)

- AngularJS - Getting Started with Routing (Programming)

- Tmux Crash Course: Tips and adjustment (Linux)

- Log4j configuration file Explanation (Linux)

- Puppet Detailed centralized configuration management system (Server)

- Hadoop + Zookeeper NameNode achieve high availability (Server)

- Timing Nginx logs cut and remove the log records of the specified number of days before (Server)

- Wi-Fi hackers use to attack your seven methods (Linux)

- Ubuntu 14.04 / 14.10 how to install FFmpeg 2.5.1 (Linux)

- shell script: the number of characters in the text to print no more than 6 words (Programming)

- How linux network security configuration (Linux)

- CentOS 6.5 boot automatically mount the hard drive (Linux)

- Fedora 8 configured Heartbeat (Linux)

- How to create a secure and easy to remember password (Linux)

- Using DOS command to change UNIX administrator password (Linux)

- Spring Integration ehcache annotation implement the query cache and cache update or delete instant (Programming)

- Install Jetty on CentOS / RHEL 6.X (Server)

- Ubuntu 14.04 LTS 64-bit install GNS3 1.3.7 (Linux)

  Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs
  Add Date : 2018-11-21      
  The purpose of writing this article is to help those who write programs but also necessary to use Visual Studio to develop and debug embedded Linux program hardy programmers!

First, install WinGDB, download location http://www.wingdb.com/, the connection is http://www.wingdb.com/WinGDB-latest_trial.msi 30-day trial version after 30 days uninstall it, delete all gdb relevant registry, and then re-installed, and can be used for 30 days, the installation process as shown below:

1, agree to the license agreement

2, if you machine is equipped with a sufficient number of VS version, you have the choice, mainly to see you use that version of VS

3, if you make only a remote Linux developers, then select the first item, if you do embedded system development, the second choice, if you want to be all, the third option, of course, is where we select the third a.

Next, create WinGDB project

1, the new WinGDB project, select Multiplatform executable

2, select the first item, we have to conduct remote development, source code in the build on a remote server, debugging is also on the remote host to access the machine via TCP / IP connection and using the SSH protocol.

3, the second choice, gdb and cross-compiler environment on a single server, remote debugging on another machine, this machine can be arm linux may be other support gdbserver machines.

4. Fill in gdb and compiler environment ssh address and user name and password for the user name and password gdbserver where the IP address.

5. Browse to choose our thinking about precompiled gdb debugger, which is compiled to run on that server gdb environment, to control the gdbserver, gdb and gdbserver must be corresponding.

6, select the local source and remote source synchronous manner, according to this situation to choose, if you are sharing, select the first option, if you want to synchronize, then choose the second, if not synchronized, the third election items, as shown:

 7, select Remote file path and the local file path:

8, set the compile command, and build directories, directory on the server to compile these directories are listed when you click the browse

9, select the destination directory for remote debugging

10, select additional and additional source files and libraries, skip this step, if you need to, you can then set here.

11, set up debugging boot parameters at the same time, it is recommended to remove Stop in main, so to avoid each time you start the program, should be in the main function where to stop.

12, the configuration is complete

My configuration as follows:

Project build command: make
Project rebuild command: make clean; make
Project clean command: make clean
Project deploy command:
Build working directory: / root / ct / src /
Build environment variables: BUILD_CONFIGURATION = "Debug"
Build before start debugging: Build project
Deploy before start debugging: yes
Deploy action: Transfer file to target
Deploy only if file changed: yes
Files to deploy: / root / ct / src // EMRCV4
Deploy target directory: / mnt / EMRCV4 / BIN
Core file path:
Working directory: / mnt / EMRCV4 / BIN
Environment variables:
Stop in main (): no
Target specification:
Server mode: Launch executable
Executable on target: / mnt / EMRCV4 / BIN / EMRCV4
Launch GDB server automatically: yes
Launch server from sysroot: no
Path to gdbserver: / usr / bin / gdbserver
Server port: 2345
Server port is forwarded: no
Forwarded server port: 0
Executable path: / root / ct / src // EMRCV4
Byte order: Little endian
Initialization script:
Additional source directories:
Debug info directory:
Sysroot on host:
Sysroot on target:
Shared library directories:
Visualizer profile:
Load sources from build host: no
Disable hang reporter: no
Debugger path: / usr / bin / arm-unknown-linux-gnueabi-gdb
Build toolchain paths:
Intercept standard IDE commands: yes
Target type: Linux indirect debugging (SSH + remote target)
Debug host login: root@ 22
Build host login: root@ 22
Debug target login: root@ 22

Debug and compile the project is now complete configuration

The third section of code mapping configuration

Then the output window will output the following:

-------------------------------------------------- ------------------------------ Transfer to remote host (s) ------------- -------------------------------------------------- -----------------

Errors were encountered during preparation: No files could be copied.

Could not map the path: D:. \ Works \ RHY \ Toll \ Trunk \ src \ FunctionAssembly \ Lane \ EMRCV4 \ EMRCV4.vcxproj to remote filesystem Use 'Map source directories' option to setup a mapping.

If present, the code mapped window open

Then add the following a Login, and then choose to add a map

Here is the effect of compile-time error because the compiler level reason, the first compilation have a lot of fault, the second compilation error disappears

When debugging, it will pop up when you start the following window, point to determine, it does not matter

Here is the case of the debugging process, you can view the local variables and runtime mouse below the current process variable value, the same as with the VS, can also single-step execution.

Step four: Include a reference to the image above you can see a lot of constants and functions have red, because VS can not find the corresponding header file, and therefore need to continue to do some settings.

Open Project Properties, select Configuration Properties, select the VC ++ directory, then in the directory containing added cross compiler environment in header files, such as:

D: \ Works \ Linux \ toolchain_R2_EABI \ usr \ arm-unknown-linux-gnueabi \ sysroot \ usr \ include

Then you need to put your entire list of all the header files to add here, if the header file directory is more, it is more strenuous.

After setting, you'll see that VS is parsing the header files, after setting the effect is as follows

Finally, if there is a problem or wizard settings are not saved, it may be the reason because it is not administrator privileges, so you might want to check under your configuration

General Settings debug host and the same build host

Environment set up the debugger path

Debugging options, to choose a good production of executable files and applications working directory on the target machine

Debug Target

gdbserver settings

The next step is critical, is the project build settings, build directory path must be the path has been mapped, otherwise an error of error unable to locate the file location,

The seventh column is set to build the project before commissioning, before commissioning the eighth set to deploy, the tenth set of deployment operations to transfer files to the target,

X is an option, if the file is changing deployment file twelfth decision to deploy, the fifth is the file where you want to deploy.


Further compilation arm and gdb related gdbserver in future articles will be introduced to! This article not be introduced. If gdb and gdbserver inconsistent, the same will not debug

Here is my gdbserver version information:

[]# gdbserver --version
GNU gdbserver (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
gdbserver is free software, covered by the GNU General Public License.
This gdbserver was configured as "arm-unknown-linux-gnueabi"

Here is gdb version information

root @ Ubuntu: / usr / bin # arm-unknown-linux-gnueabi-gdb
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3 +: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host = i686-pc-linux-gnu --target = arm-unknown-linux-gnueabi".
For bug reporting instructions, please see:

Note that we must pay attention This GDB was configured as "--host = i686-pc-linux-gnu --target = arm-unknown-linux-gnueabi".

If not, Tongyang will Bianyishibai of.

Thus fully configured, a few days later, I will be under the circumstances to supplement and improve this article if you are interested, please continue to focus on it!
- Use backup-manager system backup on Linux (Linux)
- Linux dynamic libraries and Guide (Programming)
- CentOS 6.4 dial-up Raiders (Linux)
- Install Kali Linux via PXE network (Linux)
- Introduction and MongoDB CRUD (Database)
- Summary Linux bond of multi-interface load balancing (Linux)
- Linux rpm command Detailed (Linux)
- Bash Automated Customization Linux belongs to its own CentOS system (Linux)
- linux raid levels and concepts introduced (Linux)
- FreeRadius installation process record (Linux)
- Installation and use Docker under Ubuntu 14.04 (Linux)
- Linux system security settings after installation (Linux)
- Linux print file and send mail (Linux)
- Ubuntu 14.04 build Hadoop 2.5.1 standalone and pseudo-distributed environment (32-bit) (Server)
- PyCharm new Python file name and the name of the module will import the same problem might arise (Programming)
- Build ASP.NET 5 development environment in Ubuntu (Server)
- Linux virtual machine how to access the Internet in a virtual machine when using NAT mode (Linux)
- Install Xshell on Mac OS X (Linux)
- Linux foundation tutorial: how to modify the host name on CentOS or RHEL 7 (Linux)
- Linux non-graphical interface to install Oracle Database (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.