main.c: application contains at least one write instruction

This commit is contained in:
Christian Dietrich
2014-10-22 16:09:03 +02:00
parent 520e7937a9
commit b124664aa6
2 changed files with 23 additions and 3 deletions

View File

@ -32,8 +32,27 @@ import-%: %/trace.pb
import-trace -t $< -i mem -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b mem
import-trace -t $< -i regs -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b regs --flags
import-trace -t $< -i regs -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b ip --no-gp --ip
import-trace -t $< -i ElfImporter --objdump objdump -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b ip
import-trace -t $< -i ElfImporter --objdump objdump -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b mem
import-trace -t $< -i ElfImporter --objdump objdump -e $(shell dirname $<)/system.elf -v $(shell dirname $<) -b regs
prune-trace -v $(shell dirname $<) -b %%
server-%:
generic-experiment-server -v $(subst server-,,$@) -b %
client-%:
bochs-experiment-runner.py -e $(subst client-,,$@)/system.elf \
-j $(shell getconf _NPROCESSORS_ONLN) \
-i $(subst client-,,$@)/system.iso \
-V vgabios.bin -b BIOS-bochs-latest \
-f generic-experiment-client -- \
-Wf,--state-dir=$(subst client-,,$@)/state \
-Wf,--trap -Wf,--timeout=10 \
-Wf,--ok-marker=stop_trace \
-Wf,--fail-marker=fail_marker \
-Wf,--catch-write-textsegment \
-Wf,--catch-write-outerspace
# Do never remove implicitly generated stuff
.SECONDARY:

7
main.c
View File

@ -13,14 +13,15 @@ void __attribute__ ((noinline)) stop_trace()
int array[] = {1, 1, 2, 3, 5, 8, 13, 21};
int sum;
void os_main() {
int sum = 0;
sum = 20;
for (int i = 0; i < sizeof(array)/sizeof(*array); i++) {
sum = (array[i] * 23) + 1;
sum += (array[i] * 23) + 1;
}
if (sum != 1250)
if (sum != 1270)
fail_marker();
stop_trace();
}