bao
bao copied to clipboard
this is the bao half of the Enhancements pr on pdb_wrapper
same state as before consider this as more cherry pick then pr for now
pub fn get_entities(&self, kind: EntityKind) -> Vec<Entity> {
self.0
.get_entity()
.get_children()
.into_iter()
.filter(|e| e.get_kind() == kind)
.filter(|e| !e.is_in_system_header())
.collect::<Vec<_>>()
}
im not sure this traverses the whole tree eg I think it only goes to the next level
in terms of c++ issues I am testing this tool agenst this https://github.com/jfmherokiller/CommonLibSSE/tree/ClangFixes (its a modified version of commonlibsse that is more compatable with clang.
The reason i said it might not traverse the whole tree is because these are the results
21:59:55 [INFO] Please fix these errors before continuing!
21:59:55 [INFO] Parsed 0 function definitions.
21:59:55 [INFO] Parsed 1 struct definitions.
21:59:55 [INFO] Parsed 0 global variable definitions.
21:59:55 [INFO] Parsed 5 class definitions.
21:59:55 [INFO] Parsed 1276 namespace definitions.
21:59:55 [INFO] Parsed 3 method definitions.
21:59:55 [INFO] Parsed 0 field definitions.
21:59:55 [INFO] Parsed 0 constructor definitions.
21:59:55 [INFO] Parsed 0 destructor definitions.
21:59:55 [INFO] Parsed 3 function template definitions.
21:59:55 [INFO] Parsed 0 class template definitions.
21:59:55 [INFO] Parsed 0 class template partial definitions.
im not sure this traverses the whole tree eg I think it only goes to the next level
Yeah that is accurate. I didn't write this with namespaces in mind so that is probably going to cause the brunt of the issues. We'll have recursively traverse any namespaces we encounter. Same goes for classes.
im not sure this traverses the whole tree eg I think it only goes to the next level
Yeah that is accurate. I didn't write this with namespaces in mind so that is probably going to cause the brunt of the issues. We'll have recursively traverse any namespaces we encounter. Same goes for classes.
could it be do it iteratively by checking if Getchild is null? and continuing through the list until for every entry stored in list has no children?
could it be do it iteratively by checking if Getchild is null? and continuing through the list until for every entry stored in list has no children? I don't think the issue is how to actually get the entities but rather how to encode them as a PDB. I'm not entirely sure how namespaces or classes work in PDBs.
Oh wait the smart idea would probably be a type visitor