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

  • SEARCH
  • Home
  • 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 673119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:33:37+00:00 2026-05-14T00:33:37+00:00

I have something analogous to the following code… void function(int x) { // complicated

  • 0

I have something analogous to the following code…

void function(int x)
{
    // complicated operation on x
    blah 
    blah
}

It all appears to be working fine except when x happens to be a particular value, say “273”. But x being 273 is a rare event, 99.999% of the time it is some other value. Now I wish to observe the events when this function is called with x=273, so I would like to insert a breakpoint that gets hit only with x is that value. Perhaps I could do it like this:

void function(int x)
{
    if (x == 273)
    {
        // put breakpoint on this line.
    }
    // complicated operation on x
    blah 
    blah
}

The problem is that presumably the compiler will optimise away this “if” statement because it doesn’t do anything. So my question is what should I put within the “if” statement to to make sure it gets compiled in to something… or should I be tracing the x==273 case in some completely different way.

  • 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-14T00:33:37+00:00Added an answer on May 14, 2026 at 12:33 am

    It sounds like what you’re looking for is conditional breakpoints. These are a feature of Visual Studio which allow a break point to only be hit when a very specific condition is true.

    To do this, put a break point at the start of the function. Then right click on it and select “Condition”. Then add following expression

    x == 273
    

    Now you can debug this without changing your source binary.

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

Sidebar

Related Questions

I have something analogous to the following code snippets: // file alpha.c void function_A()
I have something like the code below: for(int i=0;i<10;i++){ button=new JButton(buttons[i]); button.addActionListener(new ActionListener(){ public
I have something like this: function showFunction () { // need position and place
I have something to the effect of : <a href=# >click me</a> And: $(document).ready(function()
I have something like 27001 errors, and they are all from generated files in
Is there an analogous form of the following code: if(month == 4,6,9,11) { do
I have something like this HTML code: <ul> <li><a href=#>21</a></li> <li><a href=#>10</a></li> <li><a href=#>6</a></li>
I have something like this: $.getJSON('/scripts/commons/theScriptDoTravelBackInTime.php',{ }, function(){ // etc.. etc... } }); Is
I have some Scala code roughly analogous to this: object Foo { val thingA
I am working on something and need to solve the following. I am giving

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.