summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegia König2022-08-14 21:10:17 +0200
committerRegia König2022-08-14 21:10:17 +0200
commit848f0624bcdb1c1f60268852cfde5c71e07ee66a (patch)
tree5b903c2f22dc049e172bc6681617a8503d78515c
parentGDB Documentation (diff)
downloadmemtest86-848f0624bcdb1c1f60268852cfde5c71e07ee66a.tar.gz
memtest86-848f0624bcdb1c1f60268852cfde5c71e07ee66a.tar.xz
memtest86-848f0624bcdb1c1f60268852cfde5c71e07ee66a.zip
New script for running qemu and GDB documentation
-rw-r--r--documentation/GDB commands51
-rw-r--r--documentation/QEMU Monitor Commands2
-rwxr-xr-xtest_code/test.sh5
3 files changed, 46 insertions, 12 deletions
diff --git a/documentation/GDB commands b/documentation/GDB commands
index 761eeb9..992a6cd 100644
--- a/documentation/GDB commands
+++ b/documentation/GDB commands
@@ -4,49 +4,78 @@
###################### #############################
###################################################################
-1. QEMU CONFIGURATION
+QEMU CONFIGURATION
qemu must be started with "-s" option
(shorthand for "-gdb tcp::1234")
+#
+# GDB PART
+#
-2. GDB PART - CONNECTION
+CONNECTION
- source gdbscript
(if a gdbscript is created, which contains
add-symbol-file commandos)
- target remote localhost:1234
+DISCONNECTION
+ - detach
+ break connection with target, target resumes execution
+ GDB Target
+ (RSP Client) (RSP Server)
+ D
+ O------------------------------>O
+ O RSP exchange
+ O<------------------------------O
+ OK
+ -disconnect
+ Simply break connection. Target stays at the point where execution terminated previously
+ Reconnection(target remote): resume debugging at the point where the previous connection was broken
-3. BREAKPOINTS
+BREAKPOINTS
- - b CoreHandleProtocol | or OutputString
+ - b CoreHandleProtocol || or OutputString
+ - break *0x65fe447 || set breakpoint at address
-4. INFORMATION
+INFORMATION
- - info
- files || get Entry point + sections
+ - info
address SYM
+
all-registers || all registers & their contents
+
args || Argument variables of current stack frame
+
breakpoints
+
+ files || get Entry point + sections
files || Names of targets & files being debugged
- functions || all function names
+
+ functions || all function names in Program
+ functions UefiMain || show where this function occurs
+
locals || local variables of current stack frame
+
+ symbol ADDR || Show symbol at specified address
+
+ types [regex] || list all types or with regex
+
variables || all gloabl & static variables
-5. CONTROL FLOW
+CONTROL FLOW
- c
- bt || print back_trace of all stack frames
- stop || stop program until it reaches a different source line
-6. FILES (perhaps not applicable when debugging with QEMU)
+FILES (perhaps not applicable when debugging with QEMU)
- file MemtestEfi.efi || load file ...no debugging symbols found...done
- file || unload files
-7. LIST
+LIST
- list || list specified function or line
diff --git a/documentation/QEMU Monitor Commands b/documentation/QEMU Monitor Commands
index 4fbb27e..bae7cf7 100644
--- a/documentation/QEMU Monitor Commands
+++ b/documentation/QEMU Monitor Commands
@@ -8,7 +8,7 @@
- within viewer:
Ctrl + Alt + 2
- exit with Ctrl + Alt +
+ exit with Ctrl + Alt + 1
- as QEMU parameter to get monitor in terminal:
-monitor stdio
diff --git a/test_code/test.sh b/test_code/test.sh
new file mode 100755
index 0000000..5c9ff29
--- /dev/null
+++ b/test_code/test.sh
@@ -0,0 +1,5 @@
+
+#!\bin\bash
+
+sudo qemu-system-x86_64 -s -bios ./OVMF.fd -hda fat:rw:hda-contents \
+-net none -debugcon file:debug.log -global isa-debugcon.iobase=0x402 -S