Implicit this parameter in GDB

75 views Asked by At

I'm using Clion. How to see value of this parameter in gdb? It isn't in "Variables" section now. I've tried to print it using "Evaluate expression", but it didn't help me, it just printed {void (my_class * const)} 0x7fff5fbff298.

Also, can you explain why is it happening?

1

There are 1 answers

2
CinchBlue On

Well, technically, this is just a pointer to the object that owns it, so it should always be a regular pointer address the points to certain class. It's nothing special.

Now, once you dereference the pointer, you will be referring to the actual object. So you should try referencing *this when you want to print out the actual object.