
CLION FULL REMOTE CODE
This is because the symbol table on your local computer is not up to date after you modified the code and recompiled it on the remote server. If the debugger highlighted some code in the xv6 source folder, but the line number is wired, downloading the compiled xv6 from CS Lab server again should resolve this problem. SSH tunnel is connected to the same server as xv6 and forwarding the right port number ( ssh -L :localhost: the debugger is successfully connected to xv6, but it still doesn't stop at the breakpoints, click the pause button at the left.xv6 is running in debug mode ( make qemu-nox-gdb).If the message doesn't show up, you need to check whether In the debug tab, you should see something like "Debugger connected to localhost:25784". There is also an option for showing quick documentation on mouse move at "Editor - General - Other".įirst, make sure that the debugger is connected to the remote server. Once the previous step is done, you can press F1 on a function/variable to see the documentation. You can also directly type commands into gdb by switching to the gdb tab (when the program is paused)įor better code analysis and navigation, you can mark your xv6 folder as Project Sources and Headers, and add the line "include_directories()" to CMakeLists.txt To create a conditional breakpoint, right click on a normal breakpoint to add the condition. Pause: pause the execution of a running program (same as Ctrl+C in gdb).Continue: continue running your program (same as "c" in gdb).Step out: run until current stack frame finishes (same as "finish" in gdb).Will step into a function. (same as "s" in gdb) Here are some useful commands that you can use during debugging If the debugger doesn't stop at the breakpoint, please go to section 5: Troubleshooting. You should be able to see a debug tab open on the bottom left, which shows you the frames (same as "info frame" in gdb) and variables (same as "info variables" and "print " in gdb).
CLION FULL REMOTE DOWNLOAD
(If you cannot find this file, build xv6 again and download the built folder to your local machine)įor testing, let's create a breakpoint at kernel/proc.c:261 by clicking the space next to the line number (same as "b kernel/proc.c:261" in gdb).Ĭlick the debug button on the top-right corner. Choose the symbol file to be /kernel/kernel. Set ' target remote' args to be localhost:Ĥ. Add new configuration of type " GDB Remote Debug"ģ. Click " Edit configuration" on the top-rightĢ. (This is called SSH tunneling or SSH port forwarding so that we can access the gdb server running on the CS Lab machine via localhost: on your local machine) Note: Please leave the terminal window open at the background in the following steps. Open another terminal window, and use the following command to forward the port (recorded in step 2) on the remote server to your local machine.
CLION FULL REMOTE HOW TO
Please refer to this tutorial if you don't know how to do this.ĥ. Open CLion and sync the folder to your local machine. (What qemu-nox-gdb does is that it runs a gdb server at localhost:25784 so that gdb can later connect to this server to debug the code.)Ĥ. I always have 25784, but it might be different for you. Copy xv6 to your working directory on a CS Lab machine, build the source, and run xv6 in debug mode.
