All right, everyone.
So now let's wrap up this debugging section.
And in this lecture, I will show you how to debug any code and C++.
And basically the steps will be same for any of the other
programing languages, whether it is Java, whether it is.
By then the steps will be same.
There will be a level of changes
inside the configuration file and I will show you those.
Right.
So the first thing that I have to do is I have to explain you what the program is.
So basically in this program I am taking an integer value
and currently it is ten and I am in a loop
and I'm running this loop from one to those in need of value.
And I'm summing all the values from 1 to 10.
So the sum of all the values from one to then, as we know, is 55.
And I'm taking the average of it.
So the average of four, this will be 5.5.
And if I just compile compiling the name program,
then I can also see the average value is 5.5.
Great.
So now let me show you, I suppose due to some reasons,
the average value that I'm getting is not 5.5, right?
So suppose inside here instead of load, I took integer hill and also the return
value as integer, and this might causes some error in the average.
Right. So we need to debate that.
And in order to debug, the first thing that we need to do is
we need to add a breakpoint to our crude.
Right.
So let's add the big pointer in this important line.
And now let's go to our debugging console and we need to add our contribution.
So create a launch dot design file and click on this dude slash LLB option.
And here select the compiler that you have.
So I'm going to go with the first one and this one create
a large dot JS on file and this will start the debugging IDE.
So you can see this is the launchpad DOD JSON file
and there are a couple of settings but entail also,
if you go to this Explorer menu, then you can see a dot vs code
formula has been created and basically this has created an on the scenarios,
whether you are debugging for JavaScript, whether you are for front burner.
Nowadays there's a little present IDE.
So now in my debugging section I can see all the variables that I have,
so I can see the I and a region zero and I can continue this program.
Basically, if I click on this continue option, it will just continue
the execution of loop and it will show you me in the next video.
So if I click on this continue, then I will you will be to the valuable.
It is not changing it is ten The average will change to one by two.
And similarly I can do it once more.
Also, I can step into the program
and I can see on values are changing.
Now inside here I'm on my calculated function
and I need to step out of this calculated function.
Suppose there are thousands of lines of code,
but again, in the scale garbage function and need to go to my main function,
I support that.
I can use this a step out command.
I can simply click on it and I will be out from
my calculating action and the values will be changed.
Now, the next thing that we have here is the watch
and inside the watch I can add in any of the values.
So currently you can see I have added I as of watch,
you can also add a watch of some sort of I earned the watch of some.
Then you can see the current value of some is six
so you can add in any expression to your.
So suppose I am checking the sum is equal to ten or not.
So currently the sum is not ten.
Nova executed two more times.
Then you will find that the sum value has got ten.
Right? So this is the watch.
Now let's look at the goal stick and how it functions.
So currently I'm on my main function and I can see the main function
inside my call stack and the let me use this
a step and do function and let's go to the next to sequence execution.
So on this average variable, I will be calling the call played average function.
Now I'm on side this function and I can see
this function has been added on to my call stick.
And after execution of this function
it will read on of value of sum by end and it will pop out from the square stack.
So let's again step into once again and you can see
this has been popped out from my call stack
and it has added down the value and the changes have occurred here.
Right?
So basically this is how to debug.
Now in this code I have taken a manual menu of indigestion
and suppose you want to take your value biosensor?
Well, you want to take the value from Domino.
And first of all, you need to enter.
And here Now let me first of all, stop this debugging and let's run it again.
But inside here we are taking the scene value.
So in order to for this to work
is you need to go to your launch start date on file.
And inside here you need to set this external console value to be true.
So a set it as true
and save this file.
And once this is save, we don't need to do anything with it.
After all, I can just simply run my debug also.
let me just clear all of my watchers
so you can see this option of remove all of the watches.
It will remove simply all of the watches from my watch section.
Now let me bug it or again.
Now once you run it, it will open up a new command prompt
and it will ask me for an input.
So let's give input as well this time and let me just close it.
We don't need to give it any, any more value.
All right.
So after that we can simply execute
that program whenever or whatever we like.
And what is the size?
Then we can simply close our program.
So this is how the debugging works in inside the vehicle,
and this is all you need to know about debugging.
So if you have any issues or if you have any problem
while debugging something, you can just simply ask me in the comment section.
And if you are debugging, debugging the code
for any of the other programing languages, then inside this configuration
you will see your programing languages, whether it is Python
crab or Java, you will see it and you can configure it from here, right?
So this is pretty much add up for this course.
We have a conclusion lecture
coming up, so I will see you in that lecture.