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     - MongoDB common optimization settings in Linux (Database)

- Ubuntu treated with cue file to ape and wav files automatically track points (Linux)

- The Sublime Text 3 configuration file (Linux)

- C ++ type conversion and RTTI (Programming)

- Android gets the global process information and the memory used by the process (Programming)

- Effective Java - lazy initialization (Programming)

- Forbid screen change the window size when creating a new window under CentOS (Linux)

- Grub2: Save Your bootloader (Linux)

- Using IPFilter bridge filter in the FreeBSD system (Linux)

- How to install CentOS 7.x in OpenERP (Odoo) (Linux)

- C ++ in the elimination Wunused (Programming)

- Windows Ubuntu dual system a key Ghost, grub rescue prompt solution (Linux)

- Linux LVM - File system extension (Linux)

- Depth understanding of JavaScript new mechanism (Programming)

- MySQL database to open a remote connection method (Database)

- Hadoop upload files error solved (Server)

- Linux FTP setting file description (Server)

- Java integrated development environment common set of operations (Linux)

- Create a project using Android Studio LinearLayout (Programming)

- Let your PHP 7 faster (GCC PGO) (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!
- Linux Getting Started tutorial: How to backup Linux systems (Linux)
- Physical backup and recovery SYSTEM table space (Database)
- How to release the cache memory on Linux (Linux)
- Examples of testing and installation Mesos on CentOS (Linux)
- Sqoop data export import command (Database)
- Ubuntu 14.04 build Gitlab (Linux)
- Linux Mint brightness adjustment --xrandr command learning (Linux)
- extundelete: the Linux-based open source data recovery tools (Linux)
- Linux gprof oprofiling and performance testing tools (Linux)
- Linux System Getting Started Learning: The Linux logrotate (Linux)
- VMware difference in three network connection (Linux)
- Linux common network tools: hping Advanced Host Scan (Linux)
- Linux System Getting Started Tutorial: How to Force Change your password at next logon Linux (Linux)
- MongoDB, Cassandra, HBase transaction design strategy (Database)
- Proxmox VE implement KVM OpenVZ virtualization cloud computing (Server)
- To build a private Docker registry (Server)
- Build Docker based MongoDB replication cluster environment (Database)
- Oracle to use full-text indexing (Database)
- C ++ multithreading and critical resource instance (Programming)
- Adjustment expand VMDK format VirtualBox disk space (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.