[Lldb-commits] [lldb] r117972 - /lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Sean Callanan
scallanan at apple.com
Mon Nov 1 16:22:47 PDT 2010
Author: spyffe
Date: Mon Nov 1 18:22:47 2010
New Revision: 117972
URL: http://llvm.org/viewvc/llvm-project?rev=117972&view=rev
Log:
Improved logging and cleaned up a redundant return
statement. Now when ClangExpressionDeclMap returns
a variable for a name, it pretty-prints that
variable to the log instead of printing a (fairly
useless) NamedDecl pointer.
Modified:
lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=117972&r1=117971&r2=117972&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Mon Nov 1 18:22:47 2010
@@ -14,6 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "clang/AST/DeclarationName.h"
+#include "clang/AST/Decl.h"
#include "lldb/lldb-private.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Error.h"
@@ -35,6 +36,7 @@
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
+#include "llvm/Support/raw_ostream.h"
using namespace lldb_private;
using namespace clang;
@@ -949,8 +951,6 @@
}
return var.get();
-
- return NULL;
}
// Interface for ClangASTSource
@@ -1242,7 +1242,12 @@
if (log)
{
- log->Printf("Found variable %s, returned (NamedDecl)%p", decl_name.c_str(), var_decl);
+ std::string var_decl_print_string;
+ llvm::raw_string_ostream var_decl_print_stream(var_decl_print_string);
+ var_decl->print(var_decl_print_stream);
+ var_decl_print_stream.flush();
+
+ log->Printf("Found variable %s, returned %s", decl_name.c_str(), var_decl_print_string.c_str());
}
}
@@ -1268,7 +1273,14 @@
pvar->m_parser_vars->m_lldb_value = NULL;
if (log)
- log->Printf("Added pvar %s, returned (NamedDecl)%p", pvar->m_name.GetCString(), var_decl);
+ {
+ std::string var_decl_print_string;
+ llvm::raw_string_ostream var_decl_print_stream(var_decl_print_string);
+ var_decl->print(var_decl_print_stream);
+ var_decl_print_stream.flush();
+
+ log->Printf("Added pvar %s, returned %s", pvar->m_name.GetCString(), var_decl_print_string.c_str());
+ }
}
void
@@ -1343,7 +1355,12 @@
if (log)
{
- log->Printf("Found %s function %s, returned (NamedDecl)%p", (fun ? "specific" : "generic"), decl_name.c_str(), fun_decl);
+ std::string fun_decl_print_string;
+ llvm::raw_string_ostream fun_decl_print_stream(fun_decl_print_string);
+ fun_decl->print(fun_decl_print_stream);
+ fun_decl_print_stream.flush();
+
+ log->Printf("Found %s function %s, returned %s", (fun ? "specific" : "generic"), decl_name.c_str(), fun_decl_print_string.c_str());
}
}
More information about the lldb-commits
mailing list