Debugging QEMU with Netbeans

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
KittyFisto
Posts: 8
Joined: Wed Aug 15, 2012 5:17 pm

Debugging QEMU with Netbeans

Post by KittyFisto »

Hello again,

I'm currently trying to debug my os, running in QEMU with Netbeans, however I can't get it working for some reason. I've followed the tutorials, compiled my code with the -g and -ggdb option and I can successfully debug my code using gdb from the cygwin command line (I'm developing on a Windows machine).

I've read that I need the gdbserver plugin for netbeans in order to make this work, so I downloaded it and set it to connect to localhost:1234. The tcp connection seems to be established (I've verified this with process explorer: QEMU shows a listening tcp socket on localhost:1234 as well as an established one that matches the socket from gdb, started by netbeans I presume), however the IDE has all debugging related buttons disabled (continue, break, pause, etc..). The only button I am allowed to press is "Finish Debugger Session" which defeats the purpose of debugging...

*edit start*
I've found the debugger console which shows some errors, however I don't understand why they're produced:

Code: Select all

This log is saved to: C:\Users\simon\AppData\Local\Temp\gdb-cmds5496772142268595714.log

NB build: 201207171143

=thread-group-added,id="i1"
~"GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special)\n"
~"Copyright (C) 2011 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-cygwin\".\nFor bug reporting instructions, please see:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
=thread-group-started,id="i1",pid="42000"
=thread-created,id="1",group-id="i1"
*stopped,frame={addr="0x0000e77e",func="??",args=[]},thread-id="1",stopped-threads="all"
(gdb) 
2-list-features
3-gdb-set print repeat 0
4-gdb-set backtrace limit 1024
5-gdb-set print elements 0
6-enable-pretty-printing
7-environment-directory "D:\cygwin\home\simon\myos\"
8-file-exec-and-symbols  "D:/cygwin/home/simon/myos/"
2^done,features=["frozen-varobjs","pending-breakpoints","thread-info","data-read-memory-bytes","breakpoint-notifications","ada-task-info"]
(gdb) 
3^done
(gdb) 
4^done
(gdb) 
5^done
(gdb) 
6^done
(gdb) 
7^error,msg="Problem parsing arguments: environment-directory \"D:\\cygwin\\home\\simon\\myos\\\""
(gdb) 
8^error,msg="D:/cygwin/home/simon/myos/: No such file or directory."
(gdb) 
I don't understand where those conflicting uses of / and \ in the path strings might come from and I don't understand why they don't appear when I use gdb manually from the commandline.

This is my .gdbinit file (that is used by gdb from the commandline), if you are interested:

Code: Select all

file kernel.bin
target remote localhost:1234
**edit end*

Did anybody else try this or do you all use gdb from the commandline? Do you use another IDE that supports gdb debugging? Do you have some information that might help me to solve this problem?

Thank you for your time and help.
Post Reply