xv6 Remote Debug using CLion

This tutorial will teach you how to debug xv6 remotely using CLion. In the screenshot below, I have:
  • xv6 running remotely on a CS Lab machine
  • gdb connected to xv6 with frames and variables showed
  • code edited on the local machine and automatically synced
  • files on CS Lab machine listed
  • documentation (and declared location) shown for the selected function

(more…)

Pair Programming using VSCode

As some of you may already know, we will be allowed to work in pair going forward from P3. I found VSCode Live Share pretty useful for group programming (especially face-to-face paring programming). Roughly speaking, VSCode Live Share is Google Docs for Coding. It supports
  • Live editing
  • Focus and Follow
  • Audio calls
  • Shared terminal
  • Shared servers (not covered in this tutorial)
  • Group debugging (not covered in this tutorial)
In this tutorial, I will walk you through how to set up VS Code Live Share for code collaboration. Animated gif of 2 people highlighting editing code in real-time together. (more…)

Remotely Debug C Program using CLion

I believed that most C programmers have encountered segmentation fault before. In this case, we have to write a lot of print statements or use the command-line tool gdb to find where is wrong. Either way, it's time-consuming to debug your code only using those basic tools. This tutorial walks you through how to debug on CLion locally while having your code compile and run on remote CS Lab machines. (more…)

Setting up CLion for CS 537

As the projects get larger and more complicated, I think it is important to have a good coding environment for this course. I'd like to share with you how I use CLion as the main IDE for C programming. I recommend CLion for the following reasons:
  • Sync changed files to the remote server. You don't need to manually copy and paste the modified code to the CS lab.
  • Powerful code analysis and correction suggestion. You can eliminate most of the compilation errors while you are editing the file.
  • Built-in ssh and scp support with a handy graphical interface. For Windows users, you don't need to install PuTTY/WinSCP/WSL to connect to the CS lab.
  • Quick search and navigation. It's much easier to search files in the project folder (compared to grep) and navigate between the declaration and definition among files (compared to vim or emacs).
Please feel free to post any questions or comments down below :) (more…)