Get the value of a variable not parsed by SWIG in python

Wrote a python routine called get_value_by_ref_name that takes
a variable name string as an argument.  The string is passed to
ref_attributes to find the address and returns a REF2 structure.  The REF2
structure is passed to ref_to_value and the type and value of the variable
is returned in a structure.  We call vval_<type> to extract the raw value
from the structure and return that to python space.

Made a couple of other bug fixes in the FieldVisior and cpp input file
example found while investigating this issue.

refs #123
This commit is contained in:
Alex Lin
2015-09-18 09:03:24 -05:00
parent 2de18b9174
commit 57c76041f5
5 changed files with 44 additions and 5 deletions

View File

@ -447,6 +447,9 @@ bool FieldVisitor::VisitTypedefType(clang::TypedefType *tt) {
fdes->setHasType(true) ;
} else if ( tt->isRecordType() ) {
std::string type_name = tt->desugar().getAsString() ;
if ((pos = type_name.find("class ")) != std::string::npos ) {
type_name.erase(pos , 6) ;
}
if ((pos = type_name.find("struct ")) != std::string::npos ) {
type_name.erase(pos , 7) ;
}