A few step out fixes
Fix counted step outs, and add a test for all counted stepping commands.
Esse commit está contido em:
@@ -57,21 +57,19 @@ void CmdOut::onBeginInterrupt(DebuggerProxy &proxy, CmdInterrupt &interrupt) {
|
||||
|
||||
int currentVMDepth = g_vmContext->m_nesting;
|
||||
int currentStackDepth = proxy.getStackDepth();
|
||||
if (currentVMDepth < m_vmDepth) {
|
||||
// Cut corner here, just break when cross VM boundary no matter how
|
||||
// many levels we want to go out of
|
||||
TRACE(2, "CmdOut: shallower VM depth, done.\n");
|
||||
cleanupStepOuts();
|
||||
m_complete = true;
|
||||
} else if ((currentVMDepth == m_vmDepth) &&
|
||||
(currentStackDepth < m_stackDepth)) {
|
||||
TRACE(2, "CmdOut: same VM depth, shallower stack depth, done.\n");
|
||||
cleanupStepOuts();
|
||||
m_complete = (decCount() == 0);
|
||||
if (!m_complete) {
|
||||
TRACE(2, "CmdOut: not complete, step out again.\n");
|
||||
setupStepOuts();
|
||||
}
|
||||
|
||||
// Deeper or same depth? Keep running.
|
||||
if ((currentVMDepth > m_vmDepth) ||
|
||||
((currentVMDepth == m_vmDepth) && (currentStackDepth >= m_stackDepth))) {
|
||||
return;
|
||||
}
|
||||
|
||||
TRACE(2, "CmdOut: shallower stack depth, done.\n");
|
||||
cleanupStepOuts();
|
||||
m_complete = (decCount() == 0);
|
||||
if (!m_complete) {
|
||||
TRACE(2, "CmdOut: not complete, step out again.\n");
|
||||
onSetup(proxy, interrupt);
|
||||
}
|
||||
m_needsVMInterrupt = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
function a($a) {
|
||||
return b($a) + 1;
|
||||
}
|
||||
|
||||
function b($a) {
|
||||
return c($a) + 1;
|
||||
}
|
||||
|
||||
function c($a) {
|
||||
return d($a) + 1;
|
||||
}
|
||||
|
||||
function d($a) {
|
||||
return $a + 1;
|
||||
}
|
||||
|
||||
class C1 {
|
||||
private
|
||||
$x = 0;
|
||||
|
||||
public function __construct($a) {
|
||||
echo "C1 oh hai\n";
|
||||
$x = $a;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
echo "C1 destructor!\n";
|
||||
}
|
||||
};
|
||||
|
||||
class C2 {
|
||||
private
|
||||
$x = 0;
|
||||
|
||||
public function __construct($a) {
|
||||
echo "C2 oh hai\n";
|
||||
$x = $a;
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
echo "C2 destructor\n";
|
||||
$c = new C1(42);
|
||||
$c = null;
|
||||
echo "C2 destructor done\n";
|
||||
}
|
||||
};
|
||||
|
||||
function main() {
|
||||
$c1 = new C1(5);
|
||||
$c2 = new C2(5);
|
||||
$c2 = new C2(6);
|
||||
$d = $c1;
|
||||
$c1 = null;
|
||||
var_dump($d);
|
||||
var_dump(a(42));
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
Welcome to HipHop Debugger!
|
||||
Type "help" or "?" for a complete list of commands.
|
||||
|
||||
Program %s/flow_multistep.php loaded. Type '[r]un' or '[c]ontinue' to go.
|
||||
hphpd> break flow_multistep.php:58
|
||||
Breakpoint 1 set on line 58 of flow_multistep.php
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
object(C1)#1 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
Breakpoint 1 reached at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> step 8
|
||||
Break at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> continue
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
object(C1)#3 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
Breakpoint 1 reached at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> step 4
|
||||
Break at d() on line 17 of %s/flow_multistep.php
|
||||
16 function d($a) {
|
||||
17 return $a + 1;
|
||||
18 }
|
||||
|
||||
hphpd> step 4
|
||||
Break at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> continue
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
object(C1)#5 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
Breakpoint 1 reached at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> step 4
|
||||
Break at d() on line 17 of %s/flow_multistep.php
|
||||
16 function d($a) {
|
||||
17 return $a + 1;
|
||||
18 }
|
||||
|
||||
hphpd> next 4
|
||||
Break at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> continue
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
object(C1)#7 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
Breakpoint 1 reached at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> step 4
|
||||
Break at d() on line 17 of %s/flow_multistep.php
|
||||
16 function d($a) {
|
||||
17 return $a + 1;
|
||||
18 }
|
||||
|
||||
hphpd> out 4
|
||||
Break at main() on line 58 of %s/flow_multistep.php
|
||||
57 var_dump($d);
|
||||
58 var_dump(a(42));
|
||||
59 }
|
||||
|
||||
hphpd> continue
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> break clear all
|
||||
All breakpoints are cleared.
|
||||
hphpd> break flow_multistep.php:54
|
||||
Breakpoint 1 set on line 54 of flow_multistep.php
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
Breakpoint 1 reached at main() on line 54 of %s/flow_multistep.php
|
||||
53 $c2 = new C2(5);
|
||||
54 $c2 = new C2(6);
|
||||
55 $d = $c1;
|
||||
|
||||
hphpd> break clear all
|
||||
All breakpoints are cleared.
|
||||
hphpd> step 10
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
Break at C1::__destruct() on line 30 of %s/flow_multistep.php
|
||||
29 public function __destruct() {
|
||||
30 echo "C1 destructor!\n";
|
||||
31 }
|
||||
|
||||
hphpd> out 2
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Break at main() on line 54 of %s/flow_multistep.php
|
||||
53 $c2 = new C2(5);
|
||||
54 $c2 = new C2(6);
|
||||
55 $d = $c1;
|
||||
|
||||
hphpd> out
|
||||
object(C1)#9 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Break on line 61 of %s/flow_multistep.php
|
||||
60
|
||||
61 main();
|
||||
62
|
||||
|
||||
hphpd> continue
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> break flow_multistep.php:54
|
||||
Breakpoint 1 set on line 54 of flow_multistep.php
|
||||
hphpd> run
|
||||
C1 oh hai
|
||||
C2 oh hai
|
||||
Breakpoint 1 reached at main() on line 54 of %s/flow_multistep.php
|
||||
53 $c2 = new C2(5);
|
||||
54 $c2 = new C2(6);
|
||||
55 $d = $c1;
|
||||
|
||||
hphpd> break clear all
|
||||
All breakpoints are cleared.
|
||||
hphpd> step 10
|
||||
C2 oh hai
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
Break at C1::__destruct() on line 30 of %s/flow_multistep.php
|
||||
29 public function __destruct() {
|
||||
30 echo "C1 destructor!\n";
|
||||
31 }
|
||||
|
||||
hphpd> next 3
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Break at main() on line 54 of %s/flow_multistep.php
|
||||
53 $c2 = new C2(5);
|
||||
54 $c2 = new C2(6);
|
||||
55 $d = $c1;
|
||||
|
||||
hphpd> next
|
||||
Break at main() on line 55 of %s/flow_multistep.php
|
||||
54 $c2 = new C2(6);
|
||||
55 $d = $c1;
|
||||
56 $c1 = null;
|
||||
|
||||
hphpd> continue
|
||||
object(C1)#11 (1) {
|
||||
["x":"C1":private]=>
|
||||
int(0)
|
||||
}
|
||||
int(46)
|
||||
C1 destructor!
|
||||
C2 destructor
|
||||
C1 oh hai
|
||||
C1 destructor!
|
||||
C2 destructor done
|
||||
Program %s/flow_multistep.php exited normally.
|
||||
hphpd> quit
|
||||
@@ -0,0 +1,34 @@
|
||||
break flow_multistep.php:58
|
||||
run
|
||||
step 8
|
||||
continue
|
||||
run
|
||||
step 4
|
||||
step 4
|
||||
continue
|
||||
run
|
||||
step 4
|
||||
next 4
|
||||
continue
|
||||
run
|
||||
step 4
|
||||
out 4
|
||||
continue
|
||||
break clear all
|
||||
break flow_multistep.php:54
|
||||
run
|
||||
break clear all
|
||||
step 10
|
||||
out 2
|
||||
out
|
||||
continue
|
||||
break flow_multistep.php:54
|
||||
run
|
||||
break clear all
|
||||
step 10
|
||||
next 3
|
||||
next
|
||||
continue
|
||||
quit
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
-m debug
|
||||
Referência em uma Nova Issue
Bloquear um usuário