The --debug flag is used to debug the running machine. When this flag is set and the machine encounters a breakpoint instruction, the machine enters the DEBUG mode.
In this mode a prompt is displayed which allows the user to enter commands to inspect the state of the machine.
The commands in DEBUG mode are :
- (1) Syntax : step / s
Semantics : The execution proceeds by a single step.
- (2) Syntax : step / s <N>
Semantics : The execution proceeds by N number of steps.
- (3) Syntax : continue / c
Semantics : The execution proceeds till the next breakpoint (BRKP) instruction.
- (4) Syntax : continue / c <N>
Semantics : The execution proceeds till the next N'th occurance of the breakpoint (BRKP) instruction.
- (5) Syntax : reg / r
Semantics : Displays the contents of all the machine registers namely IP, SP, BP, PTBR, PTLR, EIP, EC, EPN, EMA, R0-R19 in that order.
-
(6) Syntax : reg / r <register_name>
Semantics : Displays the contents of the specified register.
Sample usage: r R5, reg PTLR
- (7) Syntax : mem / m <page_num>
Semantics : Writes the contents of the memory page <page_num> to the file "mem" in the XSM folder.
Sample usage: mem 5, m 20
- (8) Syntax : mem / m <page_num_1> <page_num_2> :
Semantics : Writes the contents of the memory from pages <page_num_1> to <page_num_2> to the file "mem" in XSM folder.
Sample usage: mem 5 8, m 0 10
- (9) Syntax : pcb / p
Semantics : Displays the Process Table entry of the current process.
- (10) Syntax : pcb / p <pid>
Semantics : Displays the Process Table entry of the process with the given <pid>.
- (11) Syntax : pagetable / pt
Semantics : Displays the Page Table at the location pointed by PTBR (Page Table Base Register).
- (12) Syntax : pagetable / pt <pid>
Semantics : Displays the <pid>th Page Table.
- (13) Syntax : diskmaptable / dmt
Semantics : Displays the Disk Map Table of the current process.
- (14) Syntax : diskmaptable / dmt <pid>
Semantics : Displays the Disk Map Table of the process with the given <pid>.
- (15) Syntax : resourcetable / rt
Semantics : Displays the Per-process Resource Table of the current process.
- (16) Syntax : resourcetable / rt <pid>
Semantics : Displays the Per-process Resource Table of the process with the given <pid>.
- (17) Syntax : filetable / ft
Semantics : Displays the Open File Table.
- (18) Syntax : semtable / st
Semantics : Displays the Semaphore Table.
- (19) Syntax : memfreelist / mf
Semantics : Displays the Memory Free List.
- (20) Syntax : filestatus / fst
Semantics : Displays the File Status Table.
- (21) Syntax : diskstatus / dst
Semantics : Displays the Disk Status Table.
- (22) Syntax : systemstatus / sst
Semantics : Displays the System Status Table.
- (23) Syntax : terminalstatus / tst
Semantics : Displays the Terminal Status Table.
- (24) Syntax : buffertable / bt
Semantics : Displays the Buffer Table.
- (25) Syntax : inodetable / it
Semantics : Displays the memory copy of the Inode Table.
- (26) Syntax : usertable / ut
Semantics : Displays the memory copy of the User Table.
- (27) Syntax : diskfreelist / df
Semantics : Displays the memory copy of the Disk Free List.
- (28) Syntax : rootfile / rf
Semantics : Displays the memory copy of the Root File.
- (29) Syntax : location / l <address>
Semantics : Displays the content at memory address after address translation.
- (30) Syntax : val / v <address>
Semantics : Displays the content at memory address without address translation.
- (31) Syntax : watch / w <physical_address>
Semantics : Sets a watch point to this address. Watch point is used to track changes of a particular memory location. Whenever a word which is watched is altered, program execution is stopped and the debug interface is invoked. Atmost 16 watch points can be set.
- (32) Syntax : watchclear / wc
Semantics : Clears all the watch points.
- (33) Syntax : list / ls
Semantics : List 10 instructions before and after the current instruction .
- (34) Syntax : page / pg <address>
Semantics : Displays the Page Number and Offset for the given <address>.
- (35) Syntax : exit / e
Semantics : Exits the debug prompt and halts the machine.
- (36) Syntax : help / h
Semantics : Displays commands in brief.
- (37) Syntax : accesslocktable / alt
Semantics : Displays the Access Lock Table. (Only available on NEXSM simulator used in Stage 28 of Roadmap)
Note: Simply pressing the Return key at the debug prompt will re-execute the previous command.