1 00:00:00,960 --> 00:00:04,300 In this lesson we'll be learning about breakpoints. 2 00:00:04,590 --> 00:00:11,310 How to set and remove and break points and how to use F nine to run to the break points. 3 00:00:11,310 --> 00:00:12,060 Let's get started. 4 00:00:14,540 --> 00:00:18,010 Let's open the Untitled one correct me. 5 00:00:18,150 --> 00:00:20,660 We run the X VB 6 00:00:25,820 --> 00:00:36,940 the first team we need to do is to run to the entry point F nine so we are the entry point. 7 00:00:37,200 --> 00:00:40,460 This is an example of a break point I said earlier. 8 00:00:40,920 --> 00:00:44,250 So to set a break point you just have to double click. 9 00:00:44,370 --> 00:00:52,360 In this column to set a break point to remove a break mine we double click can so if you wanted to celebrate 10 00:00:52,370 --> 00:01:02,120 point here at Berkeley and you press F nine and you will run all the program line by line until you 11 00:01:02,120 --> 00:01:11,780 reach this line so let's press F nine and you see it has come here then you can remove it fine by double 12 00:01:11,780 --> 00:01:18,270 clicking and then you can set and you break point by double clicking here. 13 00:01:18,560 --> 00:01:19,580 Press F nine again. 14 00:01:20,990 --> 00:01:29,640 And you will run this exit could you execute this instruction and then come to here and stop so now 15 00:01:29,640 --> 00:01:36,220 from when you are here you can remove the breakpoint if you won by double clicking add in press F it 16 00:01:39,680 --> 00:01:46,720 and then now here if you want to set another breakpoint you can set it here if you like Oh here. 17 00:01:47,080 --> 00:01:55,150 Anywhere you like but it has to be the next in the path of the execution. 18 00:01:55,240 --> 00:02:00,500 That means it must be reachable when the program runs. 19 00:02:00,790 --> 00:02:01,240 So. 20 00:02:01,280 --> 00:02:04,460 So then possibly could are not reachable by default. 21 00:02:04,750 --> 00:02:08,200 So you need to be careful where you set the breakpoint. 22 00:02:08,260 --> 00:02:16,030 So in this case we can be sure that this instruction will be reachable because we are now here and it 23 00:02:16,030 --> 00:02:18,760 could reduce execute sequence. 24 00:02:19,000 --> 00:02:30,330 So if we press F nine you execute all the code which you if you press F nine again you execute all the 25 00:02:30,330 --> 00:02:32,870 code here and he can come to here and stop. 26 00:02:33,900 --> 00:02:37,410 So when he hits a brake line he will have a will pass. 27 00:02:37,410 --> 00:02:46,120 As you can see on the bottom left he says pass ninety three means breakpoint so you can remove the earlier 28 00:02:46,130 --> 00:02:54,780 breakpoint by double clicking and double clicking then he can continue execution by pressing it by pressing 29 00:02:54,780 --> 00:02:55,170 f it. 30 00:02:56,230 --> 00:03:05,380 And if you want to say an outbreak mind you can set it somewhere where the exhibition will come across 31 00:03:05,380 --> 00:03:07,760 the construction. 32 00:03:07,840 --> 00:03:12,260 So the next instructions to all be a scooter are when you see in this part. 33 00:03:13,210 --> 00:03:19,790 So you can be sure if you set a breakpoint here you will definitely reach you and Julie. 34 00:03:19,820 --> 00:03:21,210 So let's press F nine now. 35 00:03:21,230 --> 00:03:28,860 After setting this breakpoint in China investigator on instruction and heat is required. 36 00:03:30,830 --> 00:03:34,800 And so now the judge will not be taken as you can see. 37 00:03:34,960 --> 00:03:37,610 And this is also not written in color. 38 00:03:37,630 --> 00:03:39,830 So he will just move on to the next line. 39 00:03:40,600 --> 00:03:42,070 So you press F it. 40 00:03:42,370 --> 00:03:49,260 You keep on moving then if you only put an outbreak point he can double click here. 41 00:03:49,710 --> 00:03:53,040 So you can send as many points as you want. 42 00:03:53,040 --> 00:04:01,300 And if you want to see all the points that you have set you can click on this step breakpoints and you 43 00:04:01,300 --> 00:04:08,620 can see the big bonus that has been set and the address of the idea for example this is a first break 44 00:04:08,620 --> 00:04:09,040 point. 45 00:04:09,350 --> 00:04:11,350 So we can double click on this. 46 00:04:11,410 --> 00:04:15,530 Go to Ken. 47 00:04:15,660 --> 00:04:18,930 This is the second point and double click on this and you can go. 48 00:04:19,710 --> 00:04:25,480 So the address is here 4 0 1 1 e 9 refers to this address. 49 00:04:25,710 --> 00:04:32,600 And the second point 4 0 1 2 0 4 refers to the second line. 50 00:04:33,520 --> 00:04:38,830 So we can just remove the rate point by double clicking here or we can even remotely break point from 51 00:04:38,830 --> 00:04:48,740 here by pressing delete on our keyboard or rightly remove Dan go back to a few. 52 00:04:48,820 --> 00:04:53,660 So that's how we set and remove break points and break points. 53 00:04:53,770 --> 00:04:56,770 Also useful for exiting loops. 54 00:04:56,770 --> 00:04:58,300 So let's find a loop. 55 00:04:58,390 --> 00:05:05,420 So we just press F it and try to find a loop you just keep pressing F it 56 00:05:17,430 --> 00:05:19,290 and try to find a loop 57 00:05:28,190 --> 00:05:29,600 Yes I think we find a loop. 58 00:05:30,500 --> 00:05:37,300 So if we keep pressing f it he would keep on looping and looping and looping and looping sometimes. 59 00:05:37,840 --> 00:05:43,310 You do not want to keep on pressing f it to keep on looping. 60 00:05:43,850 --> 00:05:45,000 So what do we do. 61 00:05:45,050 --> 00:05:47,700 We can set breakpoints outside of the loop. 62 00:05:48,410 --> 00:05:51,930 But first you must determine where will the. 63 00:05:51,930 --> 00:05:53,830 Could I see the loop. 64 00:05:54,470 --> 00:06:02,410 So if you press F it the only place where you can see the loop is here because oh well here is a repeating 65 00:06:04,690 --> 00:06:05,190 from here. 66 00:06:05,200 --> 00:06:06,760 You would just repeat. 67 00:06:06,760 --> 00:06:09,740 So the only place where you can see is here. 68 00:06:09,790 --> 00:06:17,360 So you set a breakpoint probably I'll say here because from here you would jump outside the loop. 69 00:06:17,370 --> 00:06:21,870 So you show break find here and now if you press F nine 70 00:06:24,820 --> 00:06:27,660 true enough it has run over the loop. 71 00:06:27,710 --> 00:06:29,920 And do you see that loop. 72 00:06:30,040 --> 00:06:37,040 So now you're outside the loop and you can remove the break point and continue f it like this. 73 00:06:37,070 --> 00:06:40,700 So this is how we use break points. 74 00:06:40,820 --> 00:06:42,960 So that's all for this lesson. 75 00:06:42,970 --> 00:06:44,210 I'll see you in the next one.