Common bochs Debugging commands
Bochs is a very easy-to-use simulator, and there are many commands, but the most common ones include several. Remember that these commands can basically meet debugging requirements.
1. breakpoint operations
(1) set the breakpoint: B physical address
For example, B 0x7c00 sets a breakpoint at the physical address 0x7c00.
(2) query breakpoints already set: info break
2. Program Execution
(1) execute the program until a breakpoint occurs: c
(2) One-step execution: S
(3) execute n commands: Step n
For example, execute three commands: Step 3.
2. Register value Query
(1) The info r command queries the value of the basic register, for example:
(2) dump_cpu
This command displays more comprehensive registers than info r, and even the shadow register values are printed out:
3. Memory Content Query
(1) query the memory of n Bytes starting from an address: XP/nbx physical address
Example: XP/32bx 0x90000 queries 32 bytes starting from 0x90000
(2) print the content in the current stack: Print-Stack
In the following example: 040803c0 is the linear address of the current running program, and 01ff53c0 is the actual physical address.
4. disassembly of a memory segment: disassemble start address termination address
For example, disassemble 0x7c3e 0x7c40 disassembles the instruction for this address.