Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dumpanddie->collect_state
  • Loading branch information
colder committed Aug 16, 2010
1 parent d911778 commit 69116dc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions php/phantm.php
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/phantm/phases/ASTPruningPhase.scala
Expand Up @@ -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 =>
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/phantm/types/TypeTransferFunction.scala
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/phantm/util/Unserializer.scala
Expand Up @@ -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
}
Expand Down

0 comments on commit 69116dc

Please sign in to comment.