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

Ask A Question

Stats

  • Questions 533k
  • Answers 533k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What about this? vncjlgpl May 17, 2026 at 12:23 am
  • Editorial Team
    Editorial Team added an answer First of all you should include ckeditor and jquery connector… May 17, 2026 at 12:23 am
  • Editorial Team
    Editorial Team added an answer You can use a transformation like : yourButton.transform = CGAffineTransformMakeRotation(45.0*M_PI/180.0);… May 17, 2026 at 12:23 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have something analogous to the following code snippets: // file alpha.c void function_A()
I have something like the following line of code: Notification notif = new Notification(R.drawable.notification_XX,
Is there an analogous form of the following code: if(month == 4,6,9,11) { do
I have something like this in my code: namespace A { namespace B {
I have something similar to this. void func() { try { //socket disconnects in
I have the following extension method that takes a List and converts it to
I have something like this: $i = 0; foreach($tracks['results'] as $track){ $trackName[$i] = $track['name'];
I have something like this: myViewController = [[MyViewController alloc] initWithNibName:@MyView bundle:nil]; [mainCanvas addSubview: myViewController.view];
I have something like this: [DisplayName(First Name)] [Required(ErrorMessage={0} is required.)] [StringLength(50, MinimumLength = 10,
I have something like Person , and Address object( Person has an Address 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.