Differences between revisions 3 and 4
Revision 3 as of 2006-05-30 13:20:38
Size: 3671
Editor: 82-38-68-217
Comment:
Revision 4 as of 2006-05-31 20:34:55
Size: 3348
Editor: 82-38-68-217
Comment:
Deletions are marked like this. Additions are marked like this.
Line 21: Line 21:
We have discussed various communication mechanisms including sockets and serial communication. For debugging from another process it became clear (after looking at other debuggers) that most people choose to go with a 'socket-based' approach. The advantages of using this approach is that it is a tried and test method that many debuggers use. However, obviously this approach becomes a problem when a programmer does not have a socket module at their disposal. One alternative to the socket approach is to use xmlrpc which allows the passing around of requests in a structured format, which may come in most handy when the debugger server is sending information to a debugger console. For instance, if someone were to write an IDE for MPdb, it would be trivial when using xmlrpc to allow the debugging server class to return a tagged message to the console which would indicate, We have discussed various communication mechanisms including sockets and serial communication. For debugging from another process it became clear (after looking at other debuggers) that most people choose to go with a 'socket-based' approach. The advantages of using this approach is that it is a tried and tested method that many debuggers use. One alternative to the socket approach is to use xmlrpc which allows the passing around of requests in a structured format, which may come in most handy when the debugger server is sending information to a debugger console. For instance, if someone were to write an IDE for MPdb, it would be trivial when using xmlrpc to allow the debugging server class to return a tagged message to the console which would indicate,
Line 25: Line 25:

However, a disadvantage to using xmlrpc is if a programmer wanted to use serial communication (this is available in gdb), they would have to undo all the xml data and turn it back into a stream of bytes.
Line 32: Line 30:
One issue the Rocky raised was that most GUI front-ends (and even gdb) will want the source available locally. This is because they all do their own parsing and scanning of the source. MPdb should allow for some way to lookup the source file locally or perhaps even send it to a remote debugging console. These are things that MPdb will have to take into account. One issue the Rocky raised was that most GUI front-ends (and even gdb) will need the source available locally. This is because they all do their own parsing and scanning of the source. MPdb should allow for some way to lookup the source file locally or perhaps even send it to a remote debugging console. These are things that MPdb will have to take into account.

Improving the Python debugger

Student: Matthew J Fleming

Mentor: Rocky Bernstein

Many people have voiced their concern that the Python debugger could be improved in a number of ways. This project aims to incorporate these suggestions into an improved version of Pdb. These improvements are to allow,

  • debugging from another process
  • debugging remotely
  • debugging a threaded application

The class that overrides Pdb and provides our enhancements is 'MPdb'.

None of the information below is set in stone and may change based on mine or Rocky's ideas and public feedback as we feel it is better to make some of the decisions (communication mechansim) open to change in the future or at least being able to make a decision later rather than sooner.

The design of these improvements has been of great importance and we have specifically concentrated on allowing future programmers to easily add to our work. For example, up until recently in the Python trunk, to get a Pdb session to send program output to some place other than stdout one had to override all of the methods in Pdb that used a 'print' statement. However, now, the version of Pdb in the trunk allows a programmer to specify both a stdin and a stdout stream. We will follow this example. The advantage of our design is that it is easily extensible and it aims to follow the gdb way to doing things.

Debugging communication techniques and ideas

We have discussed various communication mechanisms including sockets and serial communication. For debugging from another process it became clear (after looking at other debuggers) that most people choose to go with a 'socket-based' approach. The advantages of using this approach is that it is a tried and tested method that many debuggers use. One alternative to the socket approach is to use xmlrpc which allows the passing around of requests in a structured format, which may come in most handy when the debugger server is sending information to a debugger console. For instance, if someone were to write an IDE for MPdb, it would be trivial when using xmlrpc to allow the debugging server class to return a tagged message to the console which would indicate,

  • Where in the source we currently were
  • The state of some configuration variable on the server side

It became clear that the method of communication that is available to a programmer when debugging an application will change between projects. An embedded devices programmer working with python may not necessarily have access to a network card and thus, no access to network sockets. However, they may have access to a serial port on the embedded device and whilst this project may not provide code to allow communication over a serial line, it should be easy for a programmer to subclass MPdb and write one themselves, without having to undo or 'work around' any of the features or specifications or MPdb.

Where does the source live

One issue the Rocky raised was that most GUI front-ends (and even gdb) will need the source available locally. This is because they all do their own parsing and scanning of the source. MPdb should allow for some way to lookup the source file locally or perhaps even send it to a remote debugging console. These are things that MPdb will have to take into account.

SummerOfCodePdb (last edited 2008-11-15 14:00:18 by localhost)

Unable to edit the page? See the FrontPage for instructions.