Remove tracer (debugger "heaptrace" command)
[hiphop-php.git] / hphp / runtime / debugger / cmd / new_cmd.php
blob64e6f81d90017fdbd23c17251341182228aa99c4
1 <?php
3 isset($argv[1]) || die("missing {name}:\n\tphp new_cmd.php {name}\n");
4 $NAME = strtoupper($Name = ucfirst($name = strtolower($argv[1])));
6 foreach (array('h', 'cpp') as $ext) {
7 exec("cp -f cmd.$ext.template cmd_$name.$ext");
8 foreach (array('machine' => $name, 'Machine' => $Name, 'MACHINE' => $NAME)
9 as $from => $to) {
10 exec("perl -p -i -n -e 's/$from/$to/g' cmd_$name.$ext");
14 if (!isset($argv[2])) {
15 $include = "#include <runtime/eval/debugger/cmd/cmd_$name.h>";
16 exec("perl -p -i -n -e 's!$include\n!!sg' all.h");
17 exec("perl -p -i -n -e 's!^(//tag: new_cmd\.php.*)$!$include\n$1!' all.h");