Writing your own GDB Pretty Printer

  • warning: Invalid argument supplied for foreach() in /home/fsoss/html/2009/sites/all/modules/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/fsoss/html/2009/sites/all/modules/cck/theme/content-field.tpl.php on line 35.
  • warning: Invalid argument supplied for foreach() in /home/fsoss/html/2009/sites/all/modules/cck/theme/content-field.tpl.php on line 35.

Recently GDB has added the ability for users to use python scripts to specify to the debugger how their objects should be printed. This is extremely useful when printing complex objects which tend to have a lot of implementation details which are not useful during debugging. Examples of this are Standard Template Library data structures.