element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Build an application in Eclipse and GCC for Windows and Linux - supports external Libs, DLLs, Debug: Part 3: debug on both platforms
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 24 Dec 2020 8:45 PM Date Created
  • Views 987 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended

Build an application in Eclipse and GCC for Windows and Linux - supports external Libs, DLLs, Debug: Part 3: debug on both platforms

Jan Cumps
Jan Cumps
24 Dec 2020

Goal: debug the project from the previous blog.

Both the Windows and Linux version, from the same Eclipse project on your Windows laptop.

image

The Windows version as a local program - we're running eclipse on Windows and can debug locally.

The Linux version as a remote application. Our debugger will deploy on a Raspberry Pi, start the program in debug mode and link the Eclipse debugger.

In both scenarios, the effect is the same:

You start a debug session, the debugger halts on the first line of main(). You can step through the code and watch variables. You see output.

I'm using the project from the previous post. I just added some lines so that you can watch variables and see some real output.

 

#include <iostream>
using namespace std;

int main() {
  int i = 5;
  i++;
cout << "i = " << i << "." << endl;
return 0;
}

 

1: a Windows debug session

image

Select the project. Then go to Run > Debug configurations...

image

Create a new C/C++ Application configuration.

image

 

Press Debug.

It's possible that the debugger doesn't find your source file. There's a "Locate source file..." button that you can use to do this manually.

 

image

That was easy

 

2: a Linux debug session

image

Select the project. Then go to Run > Debug configurations...

 

image

Create a new C/C++ Remote Application configuration.

image

You need to enter a little more information. But in return, the debugger automatically uploads your program to the Pi (or BBB, ...) and makes it executable.

You know you've set up a correct connection, if the Browse... button allows you to navigate to a directory on your Linux box.

 

image

Set the debugger executable to the one available in your Linaro toolchain. It's the same prefix you use when setting the cross-compile toolchain.

Press Debug.

 

image

 

That was easy too.

 

In a few not too difficult steps, you get a single project that can be developed on a windows pc, built for Windows and Linux, and debugged in the warm comfort zone of your IDE.

In the next post, I discuss working with .so and .dll 3rd party libraries.

 

 

related blog
Part 1: preview
Part 2: start multi-target project
Part 3: debug on both platforms
Part 4a: link 3rd party library on Linux ARM
Part 4b: link 3rd party library on Windows
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube