From 238998f8e17b554d0c28931a61271619310a098f Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Tue, 23 Feb 2016 17:21:42 +0000 Subject: Move ``Assignment::dump()`` into its own implementation file so that it's possible to call it from gdb. --- lib/Expr/Assigment.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/Expr/Assigment.cpp (limited to 'lib/Expr/Assigment.cpp') diff --git a/lib/Expr/Assigment.cpp b/lib/Expr/Assigment.cpp new file mode 100644 index 00000000..900c6d10 --- /dev/null +++ b/lib/Expr/Assigment.cpp @@ -0,0 +1,21 @@ +//===-- Assignment.cpp ----------------------------------------------------===// +// +// The KLEE Symbolic Virtual Machine +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#include "klee/util/Assignment.h" +namespace klee { + +void Assignment::dump() { + for (bindings_ty::iterator i = bindings.begin(), e = bindings.end(); i != e; + ++i) { + llvm::errs() << (*i).first->name << "\n["; + for (int j = 0, k = (*i).second.size(); j < k; ++j) + llvm::errs() << (int)(*i).second[j] << ","; + llvm::errs() << "]\n"; + } +} +} -- cgit 1.4.1 From 9bc1d11162403e331e99d5d0494feab70ace6fbc Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Tue, 23 Feb 2016 17:25:07 +0000 Subject: When calling ``Assignment::dump()`` if there are no bindings emit a message stating this. --- lib/Expr/Assigment.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Expr/Assigment.cpp') diff --git a/lib/Expr/Assigment.cpp b/lib/Expr/Assigment.cpp index 900c6d10..635362d4 100644 --- a/lib/Expr/Assigment.cpp +++ b/lib/Expr/Assigment.cpp @@ -10,6 +10,10 @@ namespace klee { void Assignment::dump() { + if (bindings.size() == 0) { + llvm::errs() << "No bindings\n"; + return; + } for (bindings_ty::iterator i = bindings.begin(), e = bindings.end(); i != e; ++i) { llvm::errs() << (*i).first->name << "\n["; -- cgit 1.4.1