Skip to content

can not use gdb to debug #59

Open
Open
@Harry-patter

Description

Debugging with debug_qemu() in Scripts/run.sh

In the debug_qemu() function in Scripts/run.sh, the following line is executed:

echo "symbol-file $LEMOND/Kernel/build/kernel.sys" >> $(dirname $(readlink -f "$0"))/debug.gdb

This adds the following line to debug.gdb:

target remote localhost:1234
symbol-file /home/ayumi/LemonOS/Scripts/../Kernel/build/kernel.sys

However, there is no file with the above path.
So, I modified run.sh as follows:

echo "symbol-file $LEMOND/Build/sysroot/system/lemon/kernel.sys" >> $(dirname $(readlink -f "$0"))/debug.gdb

After making this change, when I added some breakpoints and typed c, something went wrong:

CPU does not support SSE4.2. LEMON OS requires x86_64-v2 support.

I then added -cpu host to the qemu-system-x86_64 command in run.sh as follows:

-qemu-system-x86_64 -cpu host

After this change, when I typed c in gdb, the OS ran fine, but I couldn’t set a breakpoint at entry. Although I could set breakpoints at other functions, when I typed c, I received the following warning:

Cannot access memory at address...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions