-fail on kdbg enter

svn path=/trunk/tools/sysreg2/; revision=838
This commit is contained in:
Christoph von Wittich 2008-09-06 15:28:55 +00:00
parent 4269086152
commit 879dcaa7f1
4 changed files with 28 additions and 9 deletions

View File

@ -62,10 +62,15 @@ bool ProcessDebugData(const char* tty, int timeout, int stage )
memset(buf, 0, sizeof(buf));
got = readln(fds[i].fd, buf, sizeof(buf));
if (got == -2) /* kernel debugger */
{
Ret = false;
goto cleanup;
}
if (got < 0) {
goto cleanup;
}
if (!got || got == 1 && buf[0] == '\33')
if (!got)
{
goto cleanup;
}
@ -95,6 +100,11 @@ bool ProcessDebugData(const char* tty, int timeout, int stage )
}
*/
}
else
{
if (got == 1 && buf[0] == '\33')
goto cleanup;
}
}
}

View File

@ -6,7 +6,7 @@
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
<boot dev='cdrom'/>
</os>
<features>
</features>
@ -21,15 +21,15 @@
<target dev='hda' bus='ide'/>
</disk>
<disk type='file' device='cdrom'>
<source file='/opt/buildbot/kvmtest/ReactOS-RegTest.iso'/>
<source file='/opt/buildbot/kvmtest/ReactOS-RegTest.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:2e:dd:df'/>
<source bridge='virbr0'/>
<target dev='vnet0'/>
<model type='pcnet'/>
<target dev='vnet0'/>
<model type='pcnet'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/4'/>

View File

@ -1,4 +1,4 @@
<settings vm="ReactOS" file="/opt/buildbot/kvmtest/reactos.xml">
<settings vm="ReactOS" file="/opt/buildbot/sysreg2/reactos.xml">
<general>
<!-- kill the VM after n milliseconds without debug msg -->
<timeout ms="20000"/>

13
utils.c
View File

@ -1,4 +1,5 @@
#include "sysreg.h"
#include <sys/sysinfo.h>
int readln(int fd, char* buffer, int size)
{
@ -7,8 +8,16 @@ int readln(int fd, char* buffer, int size)
while ((bp - buffer < size) && (got = read(fd, bp, 1)))
{
if (*bp == '\33')
return 1;
if (fd == STDIN_FILENO)
{
if (*bp == '\33')
return 1;
}
else
{
if (strstr(buffer, "kdb:>"))
return -2;
}
if (*bp++ == '\n')
return (bp - buffer);
}