Browse files

trace_instrumentor: Display unknown parameters in trace output

  • Loading branch information...
1 parent 7dcd044 commit 813a89207a68397a1df6f9f51b9a06ba8b924402 @yotamr committed Apr 12, 2012
Showing with 9 additions and 4 deletions.
  1. +1 −1 trace_instrumentor/TraceCall.h
  2. +8 −3 trace_instrumentor/trace_instrumentor.cpp
View
2 trace_instrumentor/TraceCall.h
@@ -50,7 +50,7 @@ class TraceParam {
std::set<const Type *> &referencedTypes;
TraceParam(ASTContext &_ast, Rewriter *rewriter, std::set<const Type *> &_referencedTypes) : ast(_ast), Rewrite(rewriter), referencedTypes(_referencedTypes), type_name("0") { clear(); };
- bool fromType(QualType type);
+ bool fromType(QualType type, bool fill_unknown);
bool fromExpr(const Expr *E, bool interpret_char_ptr_as_string);
unsigned long flags;
std::string const_str;
View
11 trace_instrumentor/trace_instrumentor.cpp
@@ -570,15 +570,20 @@ enum trace_severity TraceCall::functionNameToTraceSeverity(std::string function_
return trace_function_name_to_severity(function_name.c_str());
}
-bool TraceParam::fromType(QualType type) {
+bool TraceParam::fromType(QualType type, bool fill_unknown_type) {
QualType canonical_type = type.getCanonicalType();
if (parseEnumTypeParam(canonical_type)) {
return true;
} else if (parseBasicTypeParam(canonical_type)) {
return true;
}
- return false;
+ if (fill_unknown_type) {
+ const_str = "...";
+ return true;
+ } else {
+ return false;
+ }
}
bool TraceParam::fromExpr(const Expr *trace_param, bool interpret_char_ptr_as_string)
@@ -805,7 +810,7 @@ void DeclIterator::VisitFunctionDecl(FunctionDecl *D) {
if ((*I)->getNameAsString().length() == 0) {
continue;
}
- bool was_parsed = trace_param.fromType((*I)->getType().getCanonicalType());
+ bool was_parsed = trace_param.fromType((*I)->getType().getCanonicalType(), true);
if (!was_parsed) {
stmtiterator.Visit(D->getBody());
return;

0 comments on commit 813a892

Please sign in to comment.