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
Please enter at least three characters to search
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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Oracle Data Integrator (ODI): Executing A Load Plan
  • Creating a Web Project: Key Steps to Identify Issues
  • Teradata Performance and Skew Prevention Tips
  • Cost Optimization Strategies for Managing Large-Scale Open-Source Databases

Trending

  • GitHub Copilot's New AI Coding Agent Saves Developers Time – And Requires Their Oversight
  • Beyond Simple Responses: Building Truly Conversational LLM Chatbots
  • Building an AI/ML Data Lake With Apache Iceberg
  • Dropwizard vs. Micronaut: Unpacking the Best Framework for Microservices
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Stepping Backwards while Debugging: Move To Line

Stepping Backwards while Debugging: Move To Line

By 
Erich Styger user avatar
Erich Styger
·
Apr. 15, 13 · Interview
Likes (0)
Comment
Save
Tweet
Share
9.2K Views

Join the DZone community and get the full member experience.

Join For Free

it happens to me many times: i’m stepping with the debugger through my code, and ups! i made one step too far!

debugging, and made one step over too far

debugging, and made one step over too far

what now? restart the whole debugging session?

actually, there is a way to go ‘backwards’ :-)

:?: gdb has a ‘reverse debugging’ feature, described here . i’m using the eclipse based codewarrior debugger, and this debug engine is not using gdb.

the codewarrior debugger in mcu10.3 supports an eclipse feature: i select a code line in the editor view and use move to line :

move to line

move to line

what it does: it changes the current pc (program counter) of the program to that line:

performed move to line

performed move to line

now i can continue debugging from that line, e.g. stepping into that function call.

yes, this is not true backward debugging. but it is simple and very effective. to perform true backward stepping, the debugger would need to reverse all operations, typically with a rather heavy state machine and data recording. but for the usual case where i simply need to go back a few lines, the ‘move to line’ is perfect.

of course there are a few points to consider:

  1. this only changes the program counter. any variable changes/etc are not affected or reverted.
  2. in case of highly optimized code, there might be multiple sequence points per source line. so doing this for highly optimized code might not work correctly.
  3. it works ok within a function. it is not recommended to use it e.g. to set the pc outside of a function. because the context/stack frame is not set up.

:idea: i use the ‘move to line’ frequently to ‘advance’ the program execution. e.g. to bypass some long sequences i’m not interested in, or to get out of an ‘endless’ loop.

the same ‘move to line’ as available while doing assembly stepping too. see this post for details.

happy line moving :)



Eclipse CodeWarrior optimization Execution (computing) Debug (command) Data (computing) Session (web analytics) Machine

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

Opinions expressed by DZone contributors are their own.

Related

  • Oracle Data Integrator (ODI): Executing A Load Plan
  • Creating a Web Project: Key Steps to Identify Issues
  • Teradata Performance and Skew Prevention Tips
  • Cost Optimization Strategies for Managing Large-Scale Open-Source Databases

Partner Resources

×

Comments
Oops! Something Went Wrong

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
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!