This video, I want to again show you a very useful command that we can use inside GDP when you're looking
at a program or debating it.
Again, we're going to compile with the Dashty for debarking symbols and run our program within GDP
here and around the array of this program again.
And I'm going to start it and I'm going to walk through it a few times through this insert and then
step into our insert function and listed it out here in the Hashmat insert function.
So at this point, let's walk through a few different commands.
And interestingly, I see that we are working with this new pair.
Very well, and I see that it's here, but let's say we want to know what the particular type is because
you're debugging and you're really deep inside the code.
For instance, we can actually do something very interesting, which is just to type what is new pair,
and that'll actually confirm that the type is in fact a pair underscore T and star.
That's a pair underscore t pointer, which matches what we see in our source code here.
So if it happens that this variable is declared in the line right above us, that's fine.
But if we don't know what the type is, we can just type what is.
What also is means is we can use what is for other things like hash map, insert, for instance, which
is the function that we're executing.
So actually give us the type of this function which returns void matches what we see at line 61 and
shows us the inputs into this function.
So we're using more complicated structures like function pointers.
This will help us out.
So if I scroll up here.
I will actually notice that when I create a hash map, I have a hash function here, so let's see if
we can figure out what that is.
So what is?
Well, in all of our hash maps we have and so let's make sure that it is, in fact, a hash map.
And it is so.
It is.
So what is in and we want to know what the hash functions.
And it says that the type is hash function pointer.
OK, so let's find out what hash function pointer is in our code and using them or your code editor,
you can look for it manually and just type it in hash function where let's search for it and we find
it here.
There's actually a typed definition.
And this, our hash function pointer is something that returns an integer, takes in a charge, star
it.
So this is pretty neat that we can figure out what the types are.
Things even like function pointers and GDB again, can save us a lot of time by just again looking at
the code that we're around and querying what the variable types are, what the struct types are, what
the functions are, for example.
So what is, is a really useful tool.