Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not use gdb to debug #59

Open
Harry-patter opened this issue Dec 27, 2024 · 1 comment
Open

can not use gdb to debug #59

Harry-patter opened this issue Dec 27, 2024 · 1 comment

Comments

@Harry-patter
Copy link

Harry-patter commented Dec 27, 2024

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...
@UnmappedStack
Copy link

Perhaps debug this with GDB. Oh wait-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants