summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegia König2022-08-15 17:09:30 +0200
committerRegia König2022-08-15 17:09:30 +0200
commitc74fca5e3c4ff12865c57ba83702ae6586fa45a8 (patch)
treef0d590a026973f26ef3b576dbf463b7d3b75fb43
parentMore documentation and test.sh is updated to use monitor at stdio (diff)
downloadmemtest86-c74fca5e3c4ff12865c57ba83702ae6586fa45a8.tar.gz
memtest86-c74fca5e3c4ff12865c57ba83702ae6586fa45a8.tar.xz
memtest86-c74fca5e3c4ff12865c57ba83702ae6586fa45a8.zip
More documentation
-rw-r--r--documentation/DEBUG statement10
-rw-r--r--documentation/Debugging in Qemu41
-rw-r--r--documentation/GDB commands7
-rw-r--r--documentation/debug statement1
-rw-r--r--documentation/debugcon11
5 files changed, 68 insertions, 2 deletions
diff --git a/documentation/DEBUG statement b/documentation/DEBUG statement
new file mode 100644
index 0000000..eb110ff
--- /dev/null
+++ b/documentation/DEBUG statement
@@ -0,0 +1,10 @@
+
+Library to include:
+#include "Library/DebugLib.h"
+
+DEBUG (("%a: %d\n", _FUNCTION_, _LINE_));
+
+example:
+
+DEBUG((EFI_D_INFO, "My Entry Point: 0x%08x\r\n",(CHAR16*)UefiMain));
+
diff --git a/documentation/Debugging in Qemu b/documentation/Debugging in Qemu
new file mode 100644
index 0000000..6d43b3e
--- /dev/null
+++ b/documentation/Debugging in Qemu
@@ -0,0 +1,41 @@
+#########################################
+# #
+# Ways to debug in Qemu #
+# #
+#########################################
+
+DEBUGCON
+###############
+
+-debugcon file:debug.log -global isa-debugcon.iobase=0x402
+
+SERIAL
+###############
+
+-serial stdio
+ redirects the virtual serial port to the host's terminal i/o
+
+TRACE
+###############
+
+-D ./qemu_log.txt
+-d guest_errors, nochain, exec, in_asm, out_asm, op, op_opt, op_ind, int, cpu, mmu, pcall, cpu_reset, unimp, page
+
+--trace "memory_region*"
+
+MONITOR
+###############
+
+-monitor stdio
+
+or
+
+Ctrl + Alt + 2 (Exit with Ctrl + Alt + 1)
+
+GDB - GNU DEBUGGER
+#####################
+
+-s -S (when starting qemu)
+
+(gdb) target remote localhost:1234
+(gdb) c
diff --git a/documentation/GDB commands b/documentation/GDB commands
index a6db0cc..64ea1b8 100644
--- a/documentation/GDB commands
+++ b/documentation/GDB commands
@@ -13,6 +13,10 @@ QEMU CONFIGURATION
# GDB PART
#
+SYMBOL FILES
+ add-symbol-file Hello.debug 0x... -s .data 0x...
+
+
CONNECTION
- source gdbscript
(if a gdbscript is created, which contains
@@ -69,7 +73,8 @@ INFORMATION
CONTROL FLOW
- - c
+ - c || continue
+ - next || move only one step forward
- bt || print back_trace of all stack frames
- stop || stop program until it reaches a different source line
diff --git a/documentation/debug statement b/documentation/debug statement
deleted file mode 100644
index a8e192c..0000000
--- a/documentation/debug statement
+++ /dev/null
@@ -1 +0,0 @@
-DEBUG (("%a: %d\n", _FUNCTION_, _LINE_));
diff --git a/documentation/debugcon b/documentation/debugcon
new file mode 100644
index 0000000..5d914f5
--- /dev/null
+++ b/documentation/debugcon
@@ -0,0 +1,11 @@
+#########################
+# #
+# DEBUGCON #
+# #
+#########################
+
+for debug already in early bootphases
+One can connect the I/O port to either a file or a device, like /dev/stdout
+ - debugcon /dev/stdout (terminal that started Qemu process)
+ - debugcon file:qemu/debug.log (or other file name)
+