When we debug a program with printf() we have to recompile it whenever we add new printf() statements! Right!? Wrong! With gdb we can add printf() statements without recompiling a program and even add them while it is running. Adding Printfs with GDB Let’s say we have the following example program...
Most programmers prefer to write code over debugging it. Unfortunately, code breaks a lot more often than we would like and it often breaks in situations that are hard to debug. Therefore, an essential skill as a programmer is to know how to debug your code (and that of others). When facing our...
ocserv is an open-source VPN software compatible to many proprietary solutions including Cisco AnyConnect, so I use it for my iOS devices. Recently I noticed that my ocserv service was not working after upgrading to Ubuntu 22.04, and got this message: [Tue Sep 26 17:35:27 2023] traps:...
GDB is a powerful debugger. Without a doubt, we can debug multi-threaded programs with gdb. In particular, we can switch between threads, inspect the stack, and dump the registers. In this post, I would like to start with the Dining Philosophers Problem, which was first coined by Edsger...