| 03a3459e Andy McCall | 1 | // Commander X16 Emulator |
| 2 | // Execution coverage: which addresses the CPU fetched an instruction from. |
|
| 3 | |
|
| 4 | /* |
|
| 5 | -coverage <file> marks every address the CPU runs an instruction from, keeping |
|
| 6 | the bank for the two banked windows, and writes the marks to <file> when the |
|
| 7 | emulator exits: normally, or on SIGTERM, which is how a test harness stops it. |
|
| 8 | A host tool maps them to source lines through the program's line tables. |
|
| 9 | |
|
| 10 | The file is text, one run of consecutive marked addresses a line: |
|
| 11 | |
|
| 12 | x16emu-coverage 1 |
|
| 13 | m 0801-0843 low memory, $0000-$9FFF |
|
| 14 | r 03:a000-a01f a RAM bank in the $A000-$BFFF window |
|
| 15 | k 20:c000-c00a a ROM or cartridge bank in the $C000-$FFFF window |
|
| 16 | |
|
| 17 | An address is marked once however often it runs: one byte of memory per |
|
| 18 | address, and no counting in the CPU loop. |
|
| 19 | */ |
|
| 20 | ||
| 21 | |
|
| 22 | |
|
| 23 | ||
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | extern bool coverage_enabled; |
|
| 28 | extern volatile bool coverage_stop; |
|
| 29 | ||
| 30 | bool ; |
|
| 31 | void ; |
|
| 32 | void ; |
|
| 33 | ||
| 34 | |