From 69116dcbe36a37f2ed2bd1e12dd56132cbff3f58 Mon Sep 17 00:00:00 2001 From: Etienne Kneuss Date: Mon, 16 Aug 2010 13:15:34 +0200 Subject: [PATCH] dumpanddie->collect_state --- php/phantm.php | 6 +++--- src/phantm/phases/ASTPruningPhase.scala | 4 ++-- src/phantm/types/TypeTransferFunction.scala | 2 +- src/phantm/util/Unserializer.scala | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/php/phantm.php b/php/phantm.php index 9d7db7f..74c6774 100644 --- a/php/phantm.php +++ b/php/phantm.php @@ -5,7 +5,7 @@ * Dumps the state of all variables, so that it can be precisely imported * into phantm * - * Call it like that: phantm_dumpanddie(get_defined_vars()); + * Call it like that: phantm_collect_state(get_defined_vars()); * @param string $path * @return string */ @@ -33,7 +33,7 @@ function phantm_incl($path) { return $path; } -function phantm_dumpanddie(array $vars) { +function phantm_collect_state(array $vars) { $bt = debug_backtrace(); $file = $bt[0]['file']; @@ -82,7 +82,7 @@ function phantm_dumpanddie(array $vars) { $funcs = get_defined_functions(); foreach ($funcs['user'] as $f) { - if ($f == 'phantm_incl' || $f == 'phantm_dumpanddie') continue; + if ($f == 'phantm_incl' || $f == 'phantm_collect_state') continue; $rf = new ReflectionFunction($f); diff --git a/src/phantm/phases/ASTPruningPhase.scala b/src/phantm/phases/ASTPruningPhase.scala index 0f954df..49383d1 100644 --- a/src/phantm/phases/ASTPruningPhase.scala +++ b/src/phantm/phases/ASTPruningPhase.scala @@ -43,7 +43,7 @@ class ASTCollector(functs: Map[String, (String, Int)], def visit(t: Tree): Boolean = { t match { - case FunctionCall(StaticFunctionRef(_, _, Identifier("phantm_dumpanddie")), _) => + case FunctionCall(StaticFunctionRef(_, _, Identifier("phantm_collect_state")), _) => // found the call afterDump = true case fd @ FunctionDecl(Identifier(name), _, _, _) if !afterDump => @@ -74,7 +74,7 @@ class ASTPruner(ast: Program) extends ASTTransform(ast) { override def trStmts(sts: List[Statement]): List[Statement] = super.trStmts(sts).filter(_ != Void()) override def trStmt(st: Statement): Statement = st match { - case FunctionCall(StaticFunctionRef(_, _, Identifier("phantm_dumpanddie")), _) => + case FunctionCall(StaticFunctionRef(_, _, Identifier("phantm_collect_state")), _) => // found the call afterDump = true st diff --git a/src/phantm/types/TypeTransferFunction.scala b/src/phantm/types/TypeTransferFunction.scala index 29422b4..9f588f9 100644 --- a/src/phantm/types/TypeTransferFunction.scala +++ b/src/phantm/types/TypeTransferFunction.scala @@ -173,7 +173,7 @@ case class TypeTransferFunction(silent: Boolean, case _ => TAnyObject } - case FunctionCall(AST.Identifier("phantm_dumpanddie"), args) => + case FunctionCall(AST.Identifier("phantm_collect_state"), args) => for (unser <- ctx.dumpedData) { env = unser.heap.importToEnv(env) } diff --git a/src/phantm/util/Unserializer.scala b/src/phantm/util/Unserializer.scala index 85f9f52..cdbd2f0 100644 --- a/src/phantm/util/Unserializer.scala +++ b/src/phantm/util/Unserializer.scala @@ -166,7 +166,7 @@ class Unserializer(content: String) { } } case _ => - throw new UnserializeException("Invalid non-array input for dumpanddie") + throw new UnserializeException("Invalid non-array base input found in dump") } map }