Chapter 6. GObject related tools

Table of Contents

Debugging reference count problems
Writing API docs

Debugging reference count problems

The reference counting scheme used by GObject does solve quite a few memory management problems but also introduces new sources of bugs. In large applications, finding the exact spot where a the reference count of an Object is not properly handled can be very difficult. Hopefully, there exist at a too named refdbg/ which can be used to automate the task of tracking down the location of invalid code with regard to reference counting. This application intercepts the reference counting calls and tries to detect invalid behavior. It suports a filter-rule mechanism to let you trace only the objects you are interested in and it can be used together with gdb.