So I had debugging up and running with vscode and it worked great
Then I decided to make a move from the meaty skeleton makefile to CMake
Now for some strange reason I can only set breakpoints before the OS runs or whilst it is in another breakpoint
I also can't pause
If I put a breakpoint before startup I can single step and inspect data structures so I think my symbols are loaded correctly
The only way I can pause or add a breakpoint once the kernel runs is to put a stop command from QEMU
I cant find anything similar on the internet about this... is driving me nuts!
I went back to a previous commit where I was using the makefile and it works still...
Would really appreciate any help
Debugging / GDB issue when kernel is running
-
- Posts: 22
- Joined: Sun Apr 28, 2019 7:39 am
Re: Debugging / GDB issue when kernel is running
I can't see why the make system should change anything, but I've not tried debugging something produced with cmake. I gave up on VSCode debugging for the kernel as it seemed to have a number of problems, so I've gone back to gdb. If you need a gui debugger (which can be useful) you might like to check out ddd (a bit old-fashioned and clunky) or gdbgui (a browser-based interface, but you'll have to jump through a few hoops to debug a kernel, the most important being setting "target remote localhost:1234" in the gdb command window).
-
- Posts: 22
- Joined: Sun Apr 28, 2019 7:39 am
Re: Debugging / GDB issue when kernel is running
The only real difference I see is that with the original system I had a .o and .d after building... with CMake I don't
But i did file mykernel.bin and it said that debug symbols were not stripped so I guess they are built in
I'll try those IDE suggestions...although it would be strange if its vscode making the problem
Its actually a pretty nice IDE...
But i did file mykernel.bin and it said that debug symbols were not stripped so I guess they are built in
I'll try those IDE suggestions...although it would be strange if its vscode making the problem
Its actually a pretty nice IDE...
Re: Debugging / GDB issue when kernel is running
I like VSCode as an IDE for editing and building (particularly the fact that you can do remote work) even though it is a bit of a pain configuring some things. It's just the debugging that I find a bit iffy. The more I use gdbgui, the more I like it.
Re: Debugging / GDB issue when kernel is running
Have you read this article: https://vector-of-bool.github.io/docs/v ... gging.html ?
-
- Posts: 22
- Joined: Sun Apr 28, 2019 7:39 am
Re: Debugging / GDB issue when kernel is running
I hadnt actually but it turns out my configuration was the same anyway
-
- Posts: 22
- Joined: Sun Apr 28, 2019 7:39 am
Re: Debugging / GDB issue when kernel is running
thanks for the gdb gui recomendation - i really like it.
So it does work a bit better but I still can't get breakpoints or view source until I pause - but at least I can pause
Occasionally I get:
No gdb response received after 10 seconds.
Possible reasons include:
1) gdbgui, gdb, or the debugged process is not running.
2) gdb or the inferior process is busy running and needs to be interrupted (press the pause button up top).
3) Something is just taking a long time to finish and respond back to this browser window, in which case you can just keep waiting.
I have a feeling something is keeping GDB busy and it doesn't receive messages or something. Also when I quit the debug session with vscode it always told me timeout after 1000 ms
So it does work a bit better but I still can't get breakpoints or view source until I pause - but at least I can pause
Occasionally I get:
No gdb response received after 10 seconds.
Possible reasons include:
1) gdbgui, gdb, or the debugged process is not running.
2) gdb or the inferior process is busy running and needs to be interrupted (press the pause button up top).
3) Something is just taking a long time to finish and respond back to this browser window, in which case you can just keep waiting.
I have a feeling something is keeping GDB busy and it doesn't receive messages or something. Also when I quit the debug session with vscode it always told me timeout after 1000 ms