Hi I am currently debugging my code base in linux machine through GDB. I am currently facing an issue in getting value of a data member from object ptr of a class. To print the location for object ptr we can use either "p" (print) or "display" command.
For Eg: I have class like this
class abc
{
string a;
};
So in my code if I am using a pointer for class abc, then
abc* objPtr = new abc();
so after breaking at above line i will get objPtr and now I want to check value of datamember a (abc::a) value. how I could do that?
(gdb) p objPtr
$2 = {px = 0x3ba6430690, pn = {pi_ = 0x3ba6430698}}
Moreover Is there a different way to check a data member which is a list / vector ?