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     - On the Web application attack techniques Common (Linux)

- Keepalived + HAProxy high availability load balancing (Server)

- Effect MongoDB plan cache (Database)

- CentOS 6 Install Xen4.2 Virtualization Practice (Linux)

- Linux Getting Started tutorial: How to backup Linux systems (Linux)

- Spring multi data source configuration (Programming)

- C # how to generate a folder or file automatically rename (Programming)

- Analyzing Linux server architecture is 32-bit / 64-bit (Server)

- Two network security scanning tools under ubuntu (Linux)

- CentOS 6.0 system security level (Linux)

- Using Ruby to build a simple HTTP service and sass environment (Server)

- Storm basic framework for analysis (Programming)

- Java filter (Programming)

- PULL operation mechanism parsing XML Comments (Programming)

- Rails project prepared some tips small experience (Linux)

- When a software RAID data recovery and reconstruction of how failure (Linux)

- Linux Tutorial ---- fundamentals of data traffic redirection (Linux)

- jQuery get value drop-down list and select text (Programming)

- MySQL migration tool used in the production environment (Database)

- Getting Started with Linux system to learn: How do I know which processes are running on the CPU core (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
Arguments:
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@192.168.50.178: 22
Build host login: root@192.168.50.178: 22
Debug target login: root@192.168.50.58: 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.

Conclusion

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:

[192.168.50.58:/mnt/EMRCV4/BIN]# 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"
[192.168.50.58:/mnt/EMRCV4/BIN]#

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!
     
         
         
         
  More:      
 
- CentOS 6.6 shortcut command execution (Linux)
- Internet proxy workaround can not be used under Linux YUM (Linux)
- C ++, overloading, cover, hide (Programming)
- High-performance JavaScript loops and flow control (Programming)
- C ++ string in the end (Programming)
- Linux suffered SYN flood attack setting (Linux)
- Traffic monitor Linux Python Version (Programming)
- GAMIT baseline solution using batch were counted (Linux)
- How do I delete a NEEDS RECOVERY rollback state of undo tablespace (Database)
- Transfer files to Windows and Linux (Linux)
- MySQL script incremental backups (innobackupex) (Database)
- Grading defense against Linux server attacks (Linux)
- Detailed installation OpenCV2.3.1 under CentOS 6.5 (Linux)
- Ubuntu: To install chat client Chatty 0.6.1 (Linux)
- How to extend / remove swap partitions (Linux)
- Android annotation support (Support Annotations) (Programming)
- Xshell key authentication mechanism using a remote login Linux (Linux)
- IO reference Docker container (Server)
- MySQL query optimization: profile function (Database)
- Oracle large table to clean truncate .. reuse storage (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.