I have a program written in C ++ on Linux compiled with -g.
When I run it under gdb, I can
1) set breakpoints 2) at those breakpoints, print out variables 3) see the stackframe 4) given a variable that a structure, print out parts of the structure (ie how ddd displays information).
Now, given that my program is compiled with "-g" - is there anyway that I can access this power inside my program itself?
those. that my program is compiled with "-g", are there any
std::vector<string> getStackFrame();
Function that I can call to get the current frame stack at the current execution point?
Given a pointer to an object and its type ... can I do
std :: vector getClassMember (class_name);
?
I understand that the default answer is “no, C ++ does not support this level of introspection” - however, remember that I am on Linux, my program is compiled with “-g”, and gdb can do this, so it’s clear that the information there is. The question is, is there an API to access it?
EDIT: PS Naysers, I would like to see a reason to close this question.
c ++ gdb
anon
source share