Skip to content

Category Archives: software

import gdb

Occasionally I see questions about how to import gdb from the ordinary Python interpreter.  This turns out to be surprisingly easy to implement. First, a detour into PIE and symbol visibility. “PIE” stands for “Position Independent Executable”.  It uses essentially the same approach as a shared library, except it can be applied to the executable.  […]

Quick Multi-process Debugging Update

In my last post I mentioned that setting breakpoints is a pain when debugging multiple processes in GDB. While there are some bugs here (we’re actively working on them), it isn’t hard to make the basic case work.  In fact, there’s nothing to it.  Some background… Starting with GDB 7.4, we changed how basic breakpoint […]

Debugging multiple programs at once

Consider this Makefile: all: runit runit: crasher ./crasher crasher: crasher.c gcc -g -o crasher crasher.c And, here is the program it is building: int *x = 0; int main () { *x = 52; } Now, if you run “make“, eventually you will see a crash.  But how to debug the crash? Well, obviously, this […]

Difficulties of elisp

The thesis that underlies my project to translate the Emacs C code to Common Lisp is that Emacs Lisp is close enough to Common Lisp that the parts of the Emacs C code that implement Lisp can be dropped in favor of the generally superior CL implementation.  This is generally true, but there are a […]

Emacs and Common Lisp, Part 2

This is a followup to my earlier post on converting the Emacs C code into Common Lisp.  This one is a bit more technical, diving into some specifics of the conversion process. Basics One important fact is that we do not need to convert an arbitrary C program to Common Lisp.  This might or might […]

Valgrind and GDB

Valgrind 3.7.0 now includes an embedded gdbserver, which is wired to the valgrind innards in the most useful way possible.  What this means is that you can now run valgrind in a special mode (simply pass –vgdb-error=0), then attach to it from gdb, just as if you were attaching to a remote target.  Valgrind will […]

GCC and Python

When writing an earlier post, I realized I haven’t yet written about the Python plugin for GCC. This is awesome! It is by far the simplest way to write a GCC plugin. The primary reason is that the author, the amazing David Malcolm, has put a lot of effort into the polish: this plugin is […]

13. Breakpoints

Phil Muldoon added support for breakpoints to the Python API in gdb this past year.  While work here is ongoing, you can already use it to do neat things which can’t be done from the gdb CLI. The interface to breakpoints is straightforward.  There is a new Breakpoint class which you can instantiate.  Objects of […]

12. Events

There have been many new Python scripting features added to gdb since my last post on the topic.  The one I want to focus on today is event generation. I wrote a little about events in gdb-python post #9 — but a lot has changed since then.  A Google SoC student, Oguz Kayral, wrote better […]

Emacs and Common Lisp

Recently I’ve been thinking about how to rebase Emacs on Common Lisp. First, why rebase?  Performance is the biggest reason.  Emacs Lisp is a very basic lisp implementation.  It has a primitive garbage collector and basic execution model, and due to how it is written, it is quite hard to improve this in place. Seccond, […]