You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 99_Appendices/F_Debugging.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,10 +138,10 @@ If we are using debian, we most-likely need to install the *gdb* package, becaus
138
138
139
139
Currently these are the type of tui layouts available in gdb:
140
140
141
-
* asm - shows the asm code being executed
142
-
* src - shows the actual source code line executed
143
-
* regs - shows the content of the cpu registers
144
-
* split - generate a split view that shows theasm and the src layout
141
+
*`asm` - shows the asm code being executed
142
+
*`src` - shows the actual source code line executed
143
+
*`regs` - shows the content of the cpu registers
144
+
*`split` - generate a split view that shows the asm and the src layout
145
145
146
146
When in a view with multiple windows, the command `focus xyz` can be used to change which window has the current focus. Most key combinations are directed to the currently focused window, so if something isn't working as expected, that might be why. For example to get back the focus to the command view just type: `focus cmd`
147
147
@@ -198,7 +198,7 @@ While debugging with gdb, we may want to keep qemu hanging after a triple fault
198
198
199
199
### Qemu Monitor
200
200
201
-
Qemu monitor is a tool used to send complex commands to the qemu emulator, is useful to for example add/remove media images to the system, freeze/unfreeze the VM, and to inspect the state of the Virtual machine without using an external debugger.
201
+
Qemu monitor is a tool used to send complex commands to the qemu emulator, is useful to for example add/remove media images to the system, freeze/unfreeze the VM, and to inspect the state of the virtual machine without using an external debugger.
202
202
203
203
One way to start Qemu monitor on a unix system is using the following parameter when starting qemu:
Where every line describes a single virtual memory mapping. The fields are (ordered left to right): base address, limit, size and the three common flags (user, read, write).
244
+
Where every line describes a single virtual memory mapping. The fields are (ordered left to right): base `address`, `limit`, `size` and the three common flags (user, read, write).
245
245
246
246
The other command, `info tlb`, shows the state of the translation lookaside buffer. In qemu this is shown as individual address translations, and can be quite verbose. An example of what the output might look like is shown below:
In this case the line contains: _virtualaddress: physicaladdress flags_. The command is not available on all architecture, so if developing on an architecture different from `x86-64` it could not be available.
261
+
In this case the line contains: _virtualaddress: physicaladdress flags_. The command is not available on all architectures, so if developing on an architecture different from `x86-64` it could not be present.
262
262
263
263
### Debugcon
264
264
@@ -267,5 +267,5 @@ It's an extremely simple protocol, similar to serial - but with no config, where
267
267
Same is true with input (although this is quite buggy, best to use serial for this).
268
268
To enable it in qemu add this to the qemu flags `-debugcon where`. Where can be anything really, a log file for example. We can even use `-debugcon /dev/stdout` to have the output appear on the current terminal.
269
269
270
-
It's worth noting that because this is just a binary stream, and not a serial device emulation, its much faster than usual port io. And there's no state management or device setup to worry about.
270
+
It's worth noting that because this is just a binary stream, and not a serial device emulation, its much faster than usual port i/o. And there's no state management or device setup to worry about.
0 commit comments