Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3224222
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:11:52+00:00 2026-05-17T16:11:52+00:00

How do breakpoints work in C++ code? Are they special instructions inserted in between

  • 0

How do breakpoints work in C++ code? Are they special instructions inserted in between some assembler instructions when the code is compiled? Or is there something else in place? Also, how are stepping-through-the-code implemented? The same way as breakpoints…?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:11:53+00:00Added an answer on May 17, 2026 at 4:11 pm

    This is heavly depend on the CPU and debugger.

    For example, one of the possible solution on x86 CPU:

    • Insert one-byte INT3 instruction on the required place
    • Wait until breakpoint exception hits
    • Compare exception address to the list of breakpoint to determine which one
    • Do breakpoint actions
    • Replace INT3 with original byte and switch the debugged process into trace mode (step-by-step execution of CPU instructions)
    • Continue debugged process
    • Immediately you catch trace exception – the instruction was executed
    • Put INT3 back

    Watchpoints can be implemented in the similar way, but instead of INT3 you put the memory page where watched variable is into read only, or into no access mode, and wait for segmentation exception.

    Stepping through assembly can also be done by using trace mode. Stepping through source lines can also be done by placing breakpoints onto next instructions, based on debug data.

    Also some CPU has hardware breakpoint support, when you just load address into some register.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I seem to be getting breakpoints from other programmers when checking out code... Where
Is there a way that I can Programmatically set an Expires Header in code
I am debugging with breakpoints and I realize the assert call? I thought it
Is it possible? By debug I mean setting breakpoints, inspect values and advance step
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
When I use conditional breakpoint in VS2005 instead of using temporary code to check
How can breakpoints be enabled or disabled at runtime? I'm writing a test workbench
There are a couple of things I find really annoying about Visual Studio. Admittedly,
I'm creating a live mockup for a client website, and I'm having some problems
I am working with a third-party framework, and the code is pretty bad, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.