diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index f32d108f..42edc450 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 292, - BUILD_DATE => "2011-01-31", + BUILD_REVISION => 298, + BUILD_DATE => "2011-02-01", }; 1; diff --git a/modules/compiler_vm/compiler_server.pl b/modules/compiler_vm/compiler_server.pl index 22b14cff..5bdb85f8 100755 --- a/modules/compiler_vm/compiler_server.pl +++ b/modules/compiler_vm/compiler_server.pl @@ -28,6 +28,7 @@ sub vm_stop { my $pid = shift @_; return if not defined $pid; kill 'TERM', $pid; + waitpid($pid, 0); } sub vm_start { @@ -38,7 +39,9 @@ sub vm_start { } if($pid == 0) { - exec('"/cygdrive/c/Program Files (x86)\QemuManager\qemu\qemu-system-x86_64.exe" -L "C:\Program Files (x86)\QemuManager\qemu" -M "pc" -m 512 -cpu "qemu64" -vga cirrus -drive "file=C:\Program Files (x86)\QemuManager\images\Test.qcow2,index=0,media=disk" -enable-kqemu -kernel-kqemu -net none -localtime -serial "tcp:127.0.0.1:4444,server,nowait" -monitor "tcp:127.0.0.1:4445,server,nowait" -kernel-kqemu -loadvm 1 -nographic'); + my $command = 'qemu-system-x86_64 -M pc -hda /home/compiler/compiler-vm-image -m 128 -monitor tcp:127.0.0.1:4445,server,nowait -serial tcp:127.0.0.1:4444,server,nowait -boot c -loadvm 2 -nographic'; + my @command_list = split / /, $command; + exec(@command_list); } else { return $pid; } @@ -58,7 +61,7 @@ sub execute { my $pid = open(my $fh, '-|', "$cmdline 2>&1"); local $SIG{ALRM} = sub { print "Time out\n"; kill 'TERM', $pid; die "Timed-out\n"; }; - alarm(6); + alarm(5); while(my $line = <$fh>) { $result .= $line; diff --git a/modules/compiler_vm/compiler_vm_client.pl b/modules/compiler_vm/compiler_vm_client.pl index bca471ca..c8061341 100755 --- a/modules/compiler_vm/compiler_vm_client.pl +++ b/modules/compiler_vm/compiler_vm_client.pl @@ -73,7 +73,7 @@ sub compile { $pid = open2($compiler_output, $compiler, './compiler_vm_server.pl') || die "repl failed: $@\n"; print "Started compiler, pid: $pid\n"; } else { - $compiler = IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => '4444', Proto => 'tcp', Type => 'SOCK_STREAM'); + $compiler = IO::Socket::INET->new(PeerAddr => '127.0.0.1', PeerPort => '4444', Proto => 'tcp', Type => SOCK_STREAM); die "Could not create socket: $!" unless $compiler; $compiler_output = $compiler; } diff --git a/modules/compiler_vm/compiler_watchdog.pl b/modules/compiler_vm/compiler_watchdog.pl index 4785c416..239d6f94 100755 --- a/modules/compiler_vm/compiler_watchdog.pl +++ b/modules/compiler_vm/compiler_watchdog.pl @@ -95,9 +95,17 @@ sub debug_program { next if $line =~ /in main\s*\(/; $line =~ s/\s*0x[0-9a-fA-F]+\s*//; - $result .= "$line "; + $line =~ s/\s+at .*:\d+//; + + if($line !~ m/^\s*in\s+/) { + $result = "in $line from "; + } else { + $result .= "$line at "; + } } elsif($line =~ s/^\d+//) { + next if $line =~ /No such file/; + $result .= "at " if not length $result; $result .= "statement: $line"; last; diff --git a/modules/compiler_vm/runqemu b/modules/compiler_vm/runqemu index 155dbd36..f5525a61 100755 --- a/modules/compiler_vm/runqemu +++ b/modules/compiler_vm/runqemu @@ -1 +1 @@ -"/cygdrive/c/Program Files (x86)\QemuManager\qemu\qemu-system-x86_64.exe" -L "C:\Program Files (x86)\QemuManager\qemu" -M "pc" -m 512 -cpu "qemu64" -vga cirrus -drive "file=C:\Program Files (x86)\QemuManager\images\Test.qcow2,index=0,media=disk" -enable-kqemu -kernel-kqemu -net none -localtime -serial "tcp:127.0.0.1:4444,server,nowait" -monitor "tcp:127.0.0.1:4445,server,nowait" -kernel-kqemu -loadvm 1 +qemu-system-x86_64 -M pc -hda /home/compiler/compiler-vm-image -m 128 -monitor "tcp:127.0.0.1:4445,server,nowait" -serial "tcp:127.0.0.1:4444,server,nowait" -boot c -loadvm 2 diff --git a/modules/compiler_vm/runqemu.net b/modules/compiler_vm/runqemu.net index 2b8f90ec..90488402 100755 --- a/modules/compiler_vm/runqemu.net +++ b/modules/compiler_vm/runqemu.net @@ -1 +1 @@ -"/cygdrive/c/Program Files (x86)\QemuManager\qemu\qemu-system-x86_64.exe" -L "C:\Program Files (x86)\QemuManager\qemu" -M "pc" -m 512 -cpu "qemu64" -vga cirrus -drive "file=C:\Program Files (x86)\QemuManager\images\Test.qcow2,index=0,media=disk" -enable-kqemu -net nic,vlan=0,macaddr=52-54-00-F0-EC-8D,model=rtl8139 -net user,vlan=0 -localtime -serial "tcp:127.0.0.1:4444,server,nowait" -monitor "tcp:127.0.0.1:4445,server,nowait" -loadvm 1 +qemu-system-x86_64 -M pc -hda /home/compiler/compiler-vm-image -m 128 -monitor "tcp:127.0.0.1:4445,server,nowait" -serial "tcp:127.0.0.1:4444,server,nowait" -net nic,vlan=0 -net user,vlan=0,hostname=compiler -boot c -loadvm 2