Skip to content

Commit 8a86505

Browse files
committed
Added GDB debug commands in Makefile and RAEDME.md
1 parent e34c3e9 commit 8a86505

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ script:
1818
before_deploy:
1919
- git config --local user.name "scopeinfinity"
2020
- git config --local user.email "[email protected]"
21-
- git tag "latest"
21+
- git tag -f "latest"
2222

2323
deploy:
2424
provider: releases
2525
api_key:
2626
secure: "LAXKpTPXlyv9pfhEDzmon80mZf9/4Sm8aNrNmNiVW+znxL+hAJJETXTtwkvNrBON1jjFIfBHi/Walp1y0mAMmlFGHFvBvqfRakQn8yLSkZCgkBj/pmd4tDSZQFtOFmfBUrUR/5x+NVE0592c9K4fwkS8L0eOAO3bLdt2GGVdlUt5qDhiyHwTMm6wlklpWC/+w1ZuG89NJywx33VpAUJManuRyKHLEis252Kil20XaQp2aVWoIuhizcn+KdFqdqgjxR9vS8KeJVEBOu8mmDCERuoobISvpuG6OF4x0FFt7mHDBSxJgULqXKaj8+izcXA14ut2H3VXKXpTcIDFpAZ8U7J7bLkwsJq/OcjoJZUTHqE6NwGn5/CX0HQUiMO8AbuOtSNbgTwI//TYhkYX19zi02wG4nXugg9QqH1lKOD4MH13wajRMjvdI09n+RwIAx4d8irUILyiQUffbW6qvLDUqr3QawfhvXUO9EZVm2ytnCumA9Zs7xdB8zbl6Kp253Nfm5tQY7tvVyZx3Q/CiNNxbkS/U4/g/SZYi94dGNejZHs+Zee1y20eGm6HVFhpqwMB62xPr7xfG7xIo/9AsXfzf0yFzdOxD0qKBjrF4HTVgzijbjVJolWoJ0NX52Pcqz/t4TK3Bl6Zx80TrPr5cRMR24rxPcFmFckNWRhKoEzr72E="
2727
file: "build/image.vmdk"
28+
overwrite: true
2829
skip_cleanup: true
2930
on:
3031
tags: false

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ BUILD_DIR = build
22
SRC_DIR = src
33
QEMU_SHUT_FLAGS= -no-shutdown -no-reboot
44
QEMU_EXTRA_FLAGS=
5+
QEMU_GDB_PORT=9000
56

67
SRC_BOOTLOADER = $(SRC_DIR)/bootloader
78
SRC_KERNEL = $(SRC_DIR)/kernel
@@ -132,11 +133,14 @@ debug_kernel: $(kernel_core)
132133
qemu: $(image_vmdk)
133134
qemu-system-x86_64 -smp 1 -m 128M -hda $< $(QEMU_SHUT_FLAGS) $(QEMU_EXTRA_FLAGS)
134135

135-
qemu_debug: $(image_vmdk)
136+
qemu_vvv: $(image_vmdk)
136137
qemu-system-x86_64 -smp 1 -m 128M -hda $< $(QEMU_SHUT_FLAGS) -d cpu,exec,in_asm
137138

138-
qemu_xdebug: $(image_vmdk)
139-
qemu-system-x86_64 -S -gdb tcp::9000 -smp 1 -m 128M -hda $< $(QEMU_SHUT_FLAGS) -d cpu,exec,in_asm
139+
qemu_debug: $(image_vmdk)
140+
qemu-system-x86_64 -S -gdb tcp::$(QEMU_GDB_PORT) -smp 1 -m 128M -hda $< $(QEMU_SHUT_FLAGS) -d cpu,exec,in_asm
141+
142+
qemu_debug_connect:
143+
gdb -ex "target remote :$(QEMU_GDB_PORT)"
140144

141145
clean:
142146
rm -r $(BUILD_DIR)/ || echo "Build directory is clean."

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,13 @@ bash before_install.sh
3131
###### Issues on booting from the Flash Drive
3232
- Try formatting device MBR with a FAT partition.
3333
- And then burn it again with test image.
34+
35+
#### Development
36+
37+
##### Debug
38+
39+
Execute QEMU in debug mode and setup GDB server.
40+
- `make qemu_debug`
41+
42+
And then connect to GDB Server.
43+
- `make qemu_debug_connect`

before_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
apt install -y make nasm gcc cpulimit qemu-system-x86 gocr expect
2+
apt install -y make nasm gcc cpulimit qemu-system-x86 gocr expect gdb

0 commit comments

Comments
 (0)