makeopensource / mOS

MakeOpenSource Operating System
GNU General Public License v3.0
4 stars 8 forks source link

Qemu GDB #42

Closed emilkovacev closed 1 year ago

emilkovacev commented 1 year ago

Description

GDB with qemu is a bit more involved than usual, so I added two commands to the Makefile, qemu-gdb and qemu-gdb-boot, for debugging in real and protected mode. I also added a doc explaining the details in docs/gdb.md.

There was no issue created for this task (I wrote it to work on #30)

Type of change

Testing

I ran make test, make qemu, and was able to run qemu through gdb with the two commands I created.

Checklist:

emilkovacev commented 1 year ago

One issue I was getting was QEMU would sometimes take too long to start causing gdb to timeout the connection. This seems to be occurring because WSL is really slow. Is there an easy fix like waiting for QEMU to start? (not worth fixing if it isn't easy IMO)

The easy fix would be doing it in two different windows – i.e. to run gdb you run make qemu in one window, and make qemu-gdb in another. We'd have to edit the commands to do that, otherwise we'd run the chance of having two instances open at the same time. It would make only slightly more inconvenient to do everything, but it's not a huge deal

Sploder12 commented 1 year ago

The easy fix would be doing it in two different windows – i.e. to run gdb you run make qemu in one window, and make qemu-gdb in another. We'd have to edit the commands to do that, otherwise we'd run the chance of having two instances open at the same time. It would make only slightly more inconvenient to do everything, but it's not a huge deal

I like having a single command in a single window. I don't think it's worth it to change anything then

emilkovacev commented 1 year ago

The easy fix would be doing it in two different windows – i.e. to run gdb you run make qemu in one window, and make qemu-gdb in another. We'd have to edit the commands to do that, otherwise we'd run the chance of having two instances open at the same time. It would make only slightly more inconvenient to do everything, but it's not a huge deal

I like having a single command in a single window. I don't think it's worth it to change anything then

On second thought (and after a bit of research), we could also increase the timeout duration within gdb to something like 10 or 20 seconds through the -ex flag

Sploder12 commented 1 year ago

On second thought (and after a bit of research), we could also increase the timeout duration within gdb to something like 10 or 20 seconds through the -ex flag

That would probably work well

emilkovacev commented 1 year ago

I pushed a commit with those changes, and added an FAQ section to the docs