Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trace_instrumentor: Display unknown parameters in trace output

  • Loading branch information...
commit 813a89207a68397a1df6f9f51b9a06ba8b924402 1 parent 7dcd044
@yotamr authored
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,7 +570,7 @@ 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;
@@ -578,7 +578,12 @@ bool TraceParam::fromType(QualType 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;
Please sign in to comment.
Something went wrong with that request. Please try again.