What are Break points in C++ | Easy and epic 2021

Break points

Break points in c++ Today what we can talk about is just kind of a bit of a quick visual studio Tampa just a tip in general the development and for the body and that’s going to be about break points but not just about break points you know what my point is that a yeah but this isn’t just me about on break points it’s going to be about conditions and actions that we can apply to break point sort by conditions all conditional breakpoints what I mean is we can actually tell the difference the job I want to place a break point here but I only want the break point to trade under certain conditions something in memory basically that’s going to meet my criteria if that’s the case then please forgive this break point and an actionable break points action break points I just something that’ll allow us to take some kind of action journal print something to the console when a breakpoint is hit so that’s kind of true I guess types of action break points there’s one that left the lights you kind of just continue execution while printing what you want so for example let’s just say I want to log the mouse position what I could do is every time. Break points Break points

The mouse position is recorded because like every time outs move event happens for example I could have that break point actually print something to the console but keep the program running or I could get it’s like prints on into the console but still break the programs is to conduct polls education of the program so that we can inspect all the things in memory starts again break points in general make sure you watch that article because if you’re on a break point is this isn’t going to really help much box. Actually break my signature right points out really useful as kind of a feather debugging tool now everything that you can do with these breakpoints exactly doing card okay I could just ride in a statement for example the check something and then obviously just put right point inside that a statement and if that if that is true in the right probably tripped why I don’t even have to put a breakpoint just even write debug break or something like that some kind of compiler intrinsic that actually will break the bond out if it’s attached at that given lines cut it kind of like what we do with a session her as.  Break points Break points

That’s one possibility and with action break once again pretty sums of console obviously you know that card but where this really comes in handy is where we might have gotten a program into some kind of state that is a blog hops and we wanted to inspect certain kind of properties to figure out what like what causes Bible what why am I in this title what even is this day like right like what is mine stuff set to why have why this happened and obviously if we want to actually everyone actually kind of decide to add codes that could basically have to terminate the application and then recompile it and then that would be an issue because maybe we couldn’t get into the study I mean it was really difficult to get to stay and I mean generally we just slowed down our work flow or if we have to keep kind of stopping or compiling on a card like and then getting up to the state the lead up to like why would like what exactly we want to debug and all that so it’s a huge issue here and this really does help us out a lot let’s dive into some cards what I want here actually is the source code to Spock he which is again after that I made about 3 years ago.  Break points Break points

And I want to do is I’ll just launch and I show you guys what we’re dealing with this is just an example project I could be anything but I thought I actually use kind of a real world project is that just doing something like that and our allies some kind of way hello world out the problem and sure enough so all we have here is really just is this scene which has. Some graphics and when I finally opens and then we have like you know some metal and plastic bowls of various references and all of that in fact I think they have been jailed Russian Spock is a bit not as good as the direct accessions Jamarcus model fast anyway the point is we have kind of a 3 apps you know and what I want to do is while this is running without actually closing and I’m going to do I just decided I wanted to plug the mouse position because the position amounts to seems to be the wrong so what I’ll do is I’ll go to a car that actually because the mouse positions which in this case is with win 33 input does every day Thomas closes in order for you to make some more space. And then what I’m going to do is find the mouse let’s just say the bottom call back price every time a bunch like this gets cold and we have this kind of mathematician X. and Y. that get set here now I want to do about that so what other S. Break points Break points

I’ll jump to the end of your and actually of course I’m not going to ask card only going to do is I’m super break point on this one for example I’m not right click on this break point and then go to conditions. Okay aren’t talk well let’s just look at faster we can get our actions okay and conditions and actions of both yes we can actually use a condition action together right you have to click on access and then had a condition to it otherwise it well we have to actually out something and then it will let us kind of device anyway I was someone actions Sir willow coming to the apple winter and we will decide to continue execution so why don’t we do this and we have variables that we want to do and this actually shows your buttocks and tax what we can do is just use Kelley rockets and inside the caliber I guess we can put in a variable names such as tax or input manage our M. _ message and don’t access sometime that X. is just obviously easier to write so we’ll do your axe and you can do things like cost certain costs to apply for one after in this case this is going to be an integer opposition so would say that I read away properly welcome to took place to fund straight you can. Sir X. and Y. okay so X. and then call not why and you can see that I’m kind of encompassing these variable names inside caliber and I can you know asthma attacks like the mouse position.  Break points Break points

Is that okay I never got we have that. This is close an application is still running obviously so I’m going to do is I’m going to click on anything going throughout the winter you’ll see that actually tells us what am mathematician is and if I drank was up a bit more so you guys can say and I go back to my program and I just click all over the place on the move disinfect all sizes smaller. Exam clicking all over the place and it’s telling me what. My mouse position is canceling a call that’s been called twice for some reason anyway you can say that I have the masses are being printed in real time while my applications running and I guess the big takeaway from this is obviously I could just ask for the prince that in the actual source code of the application but the cool thing is I haven’t stopped my application right I haven’t actually have to recompile any card or anything this is just while my initial applications running I’ve managed to print additional dollars the consul the other way of doing this would be just a regular break point click and then look at dinner the broken program like what’s paused and the variables but that would be way too long right yeah I can just click all over the place literally and you can say I’ll just get all the data I need immediately so it’s really powerful.  Break points Break points

Now to destinations let’s just say that I want my mouse position trying to be printed under 7 days alright maybe axis greater than 500 or something because I know when it happens on the right side of the screen so that my conditions. And you can say I’ve enabled both missions actions yeah I’ll just say X. greater than 500 okay. Excursion 500 you can’t just a conditional expression can be any billing statement and then I’ll just close that by hitting close so just by clicking on them and if I go back you’ll see that if I click on the left side screen nothing gets printed but if you look on the right side of screen prints not I okay so that’s a way for us to earn the evaluates break points under certain conditions and of course if I come back over here and go to actions again I can uncheck continue as a fusion which means that when I actually do click on left side strain often happens on the right side of screen it’ll print my values and then also you can say my program is now posts so that I can look at all the values I need over here if I really want okay so that’s it that’s conditions of actions I use these. Break points Break points

All the time when I need to because it’s a that is really powerful and they’re just really good for speeding up your web fleur again nothing you come to you via other means but it’s just if you’re in the middle of something complex specially if you’re working on a live application you nor is it showing it all down recalling the card going back it’s going to take forever and it may not even get you to the point where you have that bug in like you have that program in that report just simple state for the boxer this is something that is incredibly useful and everyone should be using. 1 thing I will say if the conditions are very useful things like loops if you have an update loop right like this is a game right so I have an update loop that’s running 60 times per second and I want to catch a particular condition that’s almost impossible to do with break points like maybe I’m you know I’m just kind of traversing this whole node hierarchy of appliances in my game and I have like 5000 and sees and. Break points Break points

I just want to break on the 1 that’s cold playoff or the 1 that’s called enemy for 405 right because that’s the problem well that’s going to be so difficult to do manual you’ll put a breakpoint you keep hitting F. 5 until you get to the point where the name of the NC equals in our enemy 405 right but if you put a condition down which says only after this break point its name is M. F. 15 look at what you’ve just done that instantly with absolutely no. I will say that the slowdown you program a lot so if you keep putting down conditional breakpoints an actual break points and all this like in a real time application you’ll probably drop to like 5 FPS something on that it will lack that’s just how they work this slower but obviously their developmental so usually that’s not going to affect you too much if you are about performance then just stop your application written pilot with some cards which handles for you instead of using the box about because having to divert task in doing this it’s quite slow and I have you guys enjoyed this article if you did you hit the like button you follow me on Twitter and Instagram as well to get updates about all my articles and stuff like that because that’s the trainer is the best way to support the series and the future channels I thank you so much to all my patrons which make this series possible in the next article going to be talking about small business you debugging features that I want to kind of introduce because we’re going to be starting some other series soon you’re going to be pretty big and I want everyone to be kind of comfortable with visual studio and what’s the cost to the point where we can develop our card.

Also See

What is Dynamic Casting in C++ | Top and Latest 2021

Leave a Comment

Your email address will not be published. Required fields are marked *