Archive for community

gdb’s backtrace command implemented in python

Posted in english with tags , , , , , , , on Monday, March 24, 2008 by bauermann

I’ve been working on Python bindings for exposing GDB’s frame_info, the internal structure it uses to keep track of the frame stack in the debuggee (or inferior, in GDB parlance). I got just enough working to be able to implement an equivalent of GDB’s backtrace command entirely in Python. The difference is that my version of the command prints older frames first and newer last, which feels more natural to me. :-)

Here’s the output I get:

(gdb) rbt
#2 0x080483bb in main at ../../src/examples/funcs.c:15
#1 0x08048391 in f1 at ../../src/examples/funcs.c:10
#0 f2 at ../../src/examples/funcs.c:5
(gdb)

A little bit more information, and the definition of the Python command which does the above can be found in my post to the mailing list. The code is on the git repo for the Python work.

new linker for Linux and others ELF OSes

Posted in english with tags , , , , , on Saturday, March 22, 2008 by bauermann

Cool, Ian Taylor (who wrote the current linker used in Linux) just announced that gold, the new linker that he has been writing, was just released. It targets only ELF systems, so I believe its design is much simplified and streamlined by this.

I find it interesting that he chose to implement it in C++. I’m glad that the “let’s do it in C because everybody knows it” mantra that so frequently determines the programming language of open source projects doesn’t always prevail. Perhaps this will help weaken the argument?

And yes, I know about KDE. It’s the exception that proves the rule. :-D
Besides, don’t forget that GNOME, the project created to react to it is in C, using the horrible GObject monstrosity.

python scripting in gdb!

Posted in english with tags , , , , , , on Friday, March 14, 2008 by bauermann

It seems the planets are finally aligning to get Python scripting support in GDB! Vladimir published his changes last month, Tromey improved on them, and I joined the bandwagon.

The work is being done in a git repo hosted by gitorious. More details here.

This looks very promising.

Update – 2008/03/15: Sorry, I was a bit cryptic in this post. It’s not really about enabling debug of Python programs using GDB (which is a neat idea, and I hope to play with it sometime). It’s about integrating a Python interpreter into GDB and exposing its internals as an API to be used by Python scripts. This will enable people to automate and extend GDB functionality using Python. This feature has been asked many times before, and finally is being addressed. Should open many possibilities.

scenes from the open source world

Posted in english with tags , , , on Friday, December 1, 2006 by bauermann

It’s well known that code review and discussions during development of new functionality are strong points of the open source development methodology. Here’s a fine example of this practice:

http://marc.theaimsgroup.com/?l=selinux&m=116326731410199&w=2

And here’s a practical example on how to present your arguments on a mailing list discussion:

http://marc.theaimsgroup.com/?l=selinux&m=116076869107136&w=2

</tongue-in-cheek>