mirror of
https://github.com/nasa/trick.git
synced 2025-06-15 13:48:18 +00:00
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:
@ -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) ;
|
||||
}
|
||||
|
Reference in New Issue
Block a user