[Mesa-dev] Debugging into Mesa Driver

Ian Romanick idr at freedesktop.org
Wed Jun 4 13:09:40 PDT 2014

On 06/04/2014 11:14 AM, roshan chaudhari wrote:
> Hello,
>         I just cloned the mesa driver from git repository. I am trying
> to debug the opengl application with mesa driver. I am not sure which
> flag to enable for debugging and where, I built a driver with
> -enable-debug in Makefile and added --DEBUG in CFLAGS in Makefile but
> still when I try to step into driver code it does not allow me. I am
> doing it with gdb in ubuntu.

Modifying the CFLAGS in the Makefile is likely to cause problems.
Instead, try

CFLAGS='-Og -ggdb3' CXXFLAGS='-Og -ggdb3' ./configure --enable-debug <your other configure options>

If your version of GCC is too old, you will need to use -O0 instead
of -Og.

That should be sufficient.  You can verify this by doing

    gdb $(which glxgears)

Then, at the gdb prompt,

    break _mesa_Clear

It will ask 

    Function "_mesa_Clear" not defined.
    Make breakpoint pending on future shared library load? (y or [n])

Answer 'y'.  Then,


If it stops in _mesa_Clear, you're good to go.

> Can anyone please help me with that?
> --
> Thanks,
> Roshan
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

More information about the mesa-dev mailing list