1
00:00:00,680 --> 00:00:06,650
This video, I want to again show you a very useful command that we can use inside GDP when you're looking

2
00:00:06,650 --> 00:00:08,060
at a program or debating it.

3
00:00:08,540 --> 00:00:14,660
Again, we're going to compile with the Dashty for debarking symbols and run our program within GDP

4
00:00:14,660 --> 00:00:16,850
here and around the array of this program again.

5
00:00:17,120 --> 00:00:22,100
And I'm going to start it and I'm going to walk through it a few times through this insert and then

6
00:00:22,110 --> 00:00:27,720
step into our insert function and listed it out here in the Hashmat insert function.

7
00:00:28,430 --> 00:00:32,030
So at this point, let's walk through a few different commands.

8
00:00:32,480 --> 00:00:37,160
And interestingly, I see that we are working with this new pair.

9
00:00:39,240 --> 00:00:46,620
Very well, and I see that it's here, but let's say we want to know what the particular type is because

10
00:00:46,620 --> 00:00:49,470
you're debugging and you're really deep inside the code.

11
00:00:49,470 --> 00:00:55,350
For instance, we can actually do something very interesting, which is just to type what is new pair,

12
00:00:55,830 --> 00:01:02,490
and that'll actually confirm that the type is in fact a pair underscore T and star.

13
00:01:02,550 --> 00:01:06,540
That's a pair underscore t pointer, which matches what we see in our source code here.

14
00:01:07,080 --> 00:01:11,790
So if it happens that this variable is declared in the line right above us, that's fine.

15
00:01:11,790 --> 00:01:14,190
But if we don't know what the type is, we can just type what is.

16
00:01:14,820 --> 00:01:23,340
What also is means is we can use what is for other things like hash map, insert, for instance, which

17
00:01:23,340 --> 00:01:25,080
is the function that we're executing.

18
00:01:25,080 --> 00:01:30,630
So actually give us the type of this function which returns void matches what we see at line 61 and

19
00:01:30,630 --> 00:01:33,270
shows us the inputs into this function.

20
00:01:33,660 --> 00:01:37,200
So we're using more complicated structures like function pointers.

21
00:01:37,230 --> 00:01:38,190
This will help us out.

22
00:01:38,490 --> 00:01:39,750
So if I scroll up here.

23
00:01:40,910 --> 00:01:48,230
I will actually notice that when I create a hash map, I have a hash function here, so let's see if

24
00:01:48,230 --> 00:01:49,430
we can figure out what that is.

25
00:01:49,760 --> 00:01:50,750
So what is?

26
00:01:51,050 --> 00:01:56,300
Well, in all of our hash maps we have and so let's make sure that it is, in fact, a hash map.

27
00:01:56,420 --> 00:01:58,010
And it is so.

28
00:01:58,040 --> 00:01:58,720
It is.

29
00:01:58,730 --> 00:02:03,980
So what is in and we want to know what the hash functions.

30
00:02:05,240 --> 00:02:08,630
And it says that the type is hash function pointer.

31
00:02:08,870 --> 00:02:14,690
OK, so let's find out what hash function pointer is in our code and using them or your code editor,

32
00:02:14,700 --> 00:02:20,810
you can look for it manually and just type it in hash function where let's search for it and we find

33
00:02:20,810 --> 00:02:21,160
it here.

34
00:02:21,170 --> 00:02:23,450
There's actually a typed definition.

35
00:02:25,040 --> 00:02:29,710
And this, our hash function pointer is something that returns an integer, takes in a charge, star

36
00:02:30,030 --> 00:02:30,210
it.

37
00:02:30,650 --> 00:02:34,670
So this is pretty neat that we can figure out what the types are.

38
00:02:34,670 --> 00:02:41,750
Things even like function pointers and GDB again, can save us a lot of time by just again looking at

39
00:02:41,750 --> 00:02:47,720
the code that we're around and querying what the variable types are, what the struct types are, what

40
00:02:47,720 --> 00:02:49,470
the functions are, for example.

41
00:02:49,490 --> 00:02:52,520
So what is, is a really useful tool.

