DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Related

  • How to Grab Eclipse Console Output Painlessly
  • Google Action With Node.js
  • Setup ActiveMQ Artemis on Windows
  • How to Create and Publish Azure Functions in Java

Trending

  • Essential JVM Tools for Garbage Collection Debugging
  • How to Test Multi-Threaded and Concurrent Java
  • From Java 8 to Java 21: How the Evolution Changed My Developer Workflow
  • Are Traditional Data Warehouses Being Devoured by Agentic AI?
  1. DZone
  2. Coding
  3. Frameworks
  4. Using GDB Server Monitor Commands From the Eclipse GDB Console

Using GDB Server Monitor Commands From the Eclipse GDB Console

With Eclipse as your IDE, it is very easy to debug an application on a board.

By 
Erich Styger user avatar
Erich Styger
·
Dec. 12, 18 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
13.6K Views

Join the DZone community and get the full member experience.

Join For Free

With Eclipse as your IDE, it is very easy to debug an application on a board. Still sometimes, it is useful to get one level down and control the GDB server directly.

Monitor Flash Download

Monitor Flash Download

In Command Line Programming and Debugging with GDB, I used a GDB client and server for command line debugging. There is an easy way to combine this approach with Eclipse: have Eclipse do the GDB server launching and use the Eclipse debug console to control the target as needed. This can be very useful during bootloader development, for example, to load a binary or PIC (Position Independent Code) fragment into RAM.

The steps below are using the NXP MCUXpresso IDE 10.2 with the SEGGER J-Link V6.40, but it can work the same or very similar for any Eclipse-GDB combination.

First, make sure you have a connection to the target (e.g. with an attach or during a normal debug session).

If needed, make a connection to the remote target:

target remote localhost:2331

connecting to target

Connecting to target

Next, I make sure the debug monitor knows my target device:

monitor device MK64FN1M0XXX12


Because the GDB Debugger console does not report everything back, it makes sense to have a check in the console for the debug server to see what is going on:

Device Selected

Device Selected

To halt and reset the device:

monitor reset

Monitor Reset

Monitor Reset

Select the device for the flash programming:

monitor flash device = MK64FN1M0XXX12

Monitor Flash Device

Monitor Flash Device

To turn on flash downloading:

monitor flash download = 1

Monitor Flash Download

Monitor Flash Download

And finally, we need to flash the binary to the microcontroller:

load Debug/MK64FN1M0xxx12_Project.axf 0x8000

Loaded Binary

Loaded Binary

The offset at the end (0x8000) is an offset used where to load the binary. In my above case, the binary is linked to address 0x0000’0000 compiled as PIC (Position Independent Code), and that way, I can load it to a different address. I find that useful especially dealing with boot loaders.

Happy monitoring!

Helpful Links

  • Command Line Programming and Debugging with GDB
Monitor (synchronization) Eclipse Console (video game CLI) Command (computing)

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How to Grab Eclipse Console Output Painlessly
  • Google Action With Node.js
  • Setup ActiveMQ Artemis on Windows
  • How to Create and Publish Azure Functions in Java

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: