kernel: print proc info on addbroken

This commit is contained in:
Giacomo Tesio 2017-08-12 23:32:35 +02:00
parent ecc2125b28
commit 93dfad6b0b
4 changed files with 53 additions and 0 deletions

25
qa/kern/broken.c Normal file
View File

@ -0,0 +1,25 @@
/*
* This file is part of Jehanne.
*
* Copyright (C) 2017 Giacomo Tesio <giacomo@tesio.it>
*
* Jehanne is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 of the License.
*
* Jehanne is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Jehanne. If not, see <http://www.gnu.org/licenses/>.
*/
#include <u.h>
#include <lib9.h>
void
main(void)
{
abort();
}

24
qa/kern/broken.runner Executable file
View File

@ -0,0 +1,24 @@
#!/cmd/rc
runner=$0
test = `{echo $runner|sed 's/.runner//'}
test_output = /tmp/output-`{basename $test}
if ( test -e $test_output) rm $test_output
$test > $test_output >[2=1] &
testpid=$apid
sleep 3
wait $testpid
if ( cat $test_output | grep suicide > /dev/null ) {
rm $test_output
echo PASS
exit PASS
}
cat $test_output
echo FAIL
exit FAIL

View File

@ -15,6 +15,7 @@
"awake_note0.c",
"awake_note1.c",
"brk.c",
"broken.c",
"execl.c",
"float.c",
"fork.c",

View File

@ -1057,6 +1057,9 @@ addbroken(Proc *p)
broken.p[broken.n++] = p;
qunlock(&broken);
dumpaproc(p);
dumpregs(p->dbgreg);
p->state = Broken;
p->psstate = 0;
sched();