[Lldb-commits] [lldb] r226744 - Expression evaluation for functions with unknown signatures on works by

Kate Stone katherine.stone at apple.com
Wed Jan 21 15:39:16 PST 2015

Author: kate
Date: Wed Jan 21 17:39:16 2015
New Revision: 226744

URL: http://llvm.org/viewvc/llvm-project?rev=226744&view=rev
Expression evaluation for functions with unknown signatures on works by
inferring the function signature.  This works well where the ABI doesn't
distinguish between variadic and fixed argument lists, but on arm64 the
calling conventions differ.  The default assumption works for fixed argument
lists, but variadic functions require explicit prototypes to be called.

By far the most common case where this is an issue is when attempting to use
 printf().  This change augments the default expression prefix to include a
working variadic prototype for the function.



Modified: lldb/trunk/source/Expression/ExpressionSourceCode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ExpressionSourceCode.cpp?rev=226744&r1=226743&r2=226744&view=diff
--- lldb/trunk/source/Expression/ExpressionSourceCode.cpp (original)
+++ lldb/trunk/source/Expression/ExpressionSourceCode.cpp Wed Jan 21 17:39:16 2015
@@ -41,6 +41,10 @@ typedef __UINTPTR_TYPE__ uintptr_t;
 typedef __SIZE_TYPE__ size_t;
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 typedef unsigned short unichar;
+extern "C"
+    int printf(const char * __restrict, ...);

More information about the lldb-commits mailing list