summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegia König2022-08-31 13:25:47 +0200
committerRegia König2022-08-31 13:25:47 +0200
commit95bef3b956c8cb07582d98d2efcdef8477bcf81a (patch)
treea43c2410b77bd346a2f830759539ad9f3220fd78
parentSetup.S documentation and new command in create_debug.sh (diff)
downloadmemtest86-95bef3b956c8cb07582d98d2efcdef8477bcf81a.tar.gz
memtest86-95bef3b956c8cb07582d98d2efcdef8477bcf81a.tar.xz
memtest86-95bef3b956c8cb07582d98d2efcdef8477bcf81a.zip
Creating gdb script
-rw-r--r--Makefile_for_memtest_gdb8
-rwxr-xr-xcreate_debug.sh22
-rw-r--r--test_code/OVMF_VARS.fdbin540672 -> 540672 bytes
-rw-r--r--test_code/memtest_gdbscript8
4 files changed, 24 insertions, 14 deletions
diff --git a/Makefile_for_memtest_gdb b/Makefile_for_memtest_gdb
index 3413741..aa1e692 100644
--- a/Makefile_for_memtest_gdb
+++ b/Makefile_for_memtest_gdb
@@ -14,7 +14,9 @@ else
endif
CFLAGS = -std=c11 -Wall -Wextra -Wshadow -m64 -march=x86-64 -mno-mmx -mno-sse -mno-sse2 \
- -fpic -fno-builtin -ffreestanding -fomit-frame-pointer -fno-stack-protector
+ -fno-builtin -ffreestanding -fomit-frame-pointer -fno-stack-protector
+
+#-fpic
## NEW PART
CFLAGS += -ggdb3 -O0 -DEFI_DEBUG=1
@@ -83,7 +85,7 @@ all: memtest.efi
-include $(subst .o,.d,$(APP_OBJS))
boot/%.o: boot/%.s
- $(AS) $< -o $@
+ $(AS) $< -o $@
boot/startup.s: ../boot/startup64.S ../boot/boot.h
@mkdir -p boot
@@ -91,7 +93,7 @@ boot/startup.s: ../boot/startup64.S ../boot/boot.h
boot/%.s: ../boot/%.S ../boot/boot.h
@mkdir -p boot
- $(CC) -E -traditional -fPIC -I../boot -o $@ $<
+ $(CC) -E -traditional -I../boot -o $@ $<
boot/efisetup.o: ../boot/efisetup.c
@mkdir -p boot
diff --git a/create_debug.sh b/create_debug.sh
index 45f4c1f..a807d2c 100755
--- a/create_debug.sh
+++ b/create_debug.sh
@@ -8,15 +8,15 @@ BSS_SIZE=$(size -B -d memtest_shared | grep memtest_shared | tr -s ' ' | cut -d'
echo $BSS_SIZE
echo "bss_size: $BSS_SIZE"
-ld --defsym=_bss_size=$(size -B -d memtest_shared | grep memtest_shared | tr -s ' ' | cut -d ' ' -f3) \
- -shared \
- --print-memory-usage \
- --print-output-format \
- -Bsymbolic \
- -M \
- -nostdlib \
- -T linker_modified.lds \
- -o memtest_modified.efi \
- boot/setup.o boot/startup.o boot/efisetup.o app/*.o lib/*.o system/*.o tests/*.o
+#ld --defsym=_bss_size=$(size -B -d memtest_shared | grep memtest_shared | tr -s ' ' | cut -d ' ' -f3) \
+# -shared \
+# --print-memory-usage \
+# --print-output-format \
+# -Bsymbolic \
+# -M \
+# -nostdlib \
+# -T linker_modified.lds \
+# -o memtest_modified.efi \
+# boot/setup.o boot/startup.o boot/efisetup.o app/*.o lib/*.o system/*.o tests/*.o
-# ld -N --defsym=_bss_size=$BSS_SIZE -T linker_modified.lds boot/header.o boot/setup.o -b elf64-x86-64 memtest_shared -o memtest_modified.efi
+ld -N --defsym=_bss_size=$BSS_SIZE -T linker_modified.lds boot/header.o boot/setup.o -b elf64-x86-64 memtest_shared -o memtest_modified.efi
diff --git a/test_code/OVMF_VARS.fd b/test_code/OVMF_VARS.fd
index 53d80c2..6252fc6 100644
--- a/test_code/OVMF_VARS.fd
+++ b/test_code/OVMF_VARS.fd
Binary files differ
diff --git a/test_code/memtest_gdbscript b/test_code/memtest_gdbscript
new file mode 100644
index 0000000..3295919
--- /dev/null
+++ b/test_code/memtest_gdbscript
@@ -0,0 +1,8 @@
+add-symbol-file ../../memtest86plus_debug/build64/memtest.debug 0x20000
+b main
+
+# while loop
+b *0x21414a
+
+# supposed main
+b *0x21412a