Differences between revisions 1 and 2
Revision 1 as of 2008-06-30 01:06:21
Size: 1551
Editor: TomTromey
Comment: new page
Revision 2 as of 2008-07-06 20:03:59
Size: 1536
Editor: TomTromey
Comment: Reformat
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
 * Breakpoints, blocks, frames, symbols, symbol tables, and values have Python representations.
 
Some of these representations are not finalized (in particular values will definitely change).
 * Breakpoints, blocks, frames, symbols, symbol tables, and values have Python representations. Some of these representations are not finalized (in particular values will definitely change).
Line 17: Line 16:
 * It should be possible to override CLI printing of a value using Python.
 
In particular code for this should be distributed with a library or executable and automatically found.
 
Pretty-printing should be the default, with a new {{{/r}}} (raw) flag to print that bypasses the display.
 * It should be possible to override CLI printing of a value using Python. In particular code for this should be distributed with a library or executable and automatically found. Pretty-printing should be the default, with a new {{{/r}}} (raw) flag to print that bypasses the display.
Line 26: Line 23:
 * It should be possible to write useful "executables" purely in Python.
 
This would mean modifying the gdb startup sequence (so a script could be used in a pipeline) and maybe adding command-line options.
 
One example of a tool like this would be a generalized {{{strace}}}, like frysk's {{{ftrace}}}.
 * It should be possible to write useful "executables" purely in Python. This would mean modifying the gdb startup sequence (so a script could be used in a pipeline) and maybe adding command-line options. One example of a tool like this would be a generalized {{{strace}}}, like frysk's {{{ftrace}}}.

PythonGdb

This page describes the work to integrate Python scripting into Gdb.

Things that work

  • You can create new gdb commands by subclassing gdb.Command

  • You can create new convenience functions by subclassing gdb.Function

  • Breakpoints, blocks, frames, symbols, symbol tables, and values have Python representations. Some of these representations are not finalized (in particular values will definitely change).
  • You can tell MI to use a Python function to change how a particular type of object is displayed.

Things we want to work

  • Values need a rewrite so that they are simpler to manipulate from Python.
  • Types need to be represented in Python.
  • It should be possible to override CLI printing of a value using Python. In particular code for this should be distributed with a library or executable and automatically found. Pretty-printing should be the default, with a new /r (raw) flag to print that bypasses the display.

  • Expressions should be represented in Python.

Big Goals

  • It should be possible to write support for a new language entirely in Python.
  • It should be possible to rewrite Insight in Python.
  • It should be possible to write useful "executables" purely in Python. This would mean modifying the gdb startup sequence (so a script could be used in a pipeline) and maybe adding command-line options. One example of a tool like this would be a generalized strace, like frysk's ftrace.

  • ... your idea here

None: PythonGdb (last edited 2013-12-04 18:03:08 by TomTromey)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.