Get Lanyrd on your mobile (iPhone, Android and more) - check it out here

Sessions at EuroPython 2011 about Debugging

Your current filters are…

Wednesday 22nd June 2011

  • Debugging and profiling techniques

    by Giovanni Bajo

    This talk will give on overview over some common problems related to profiling and debugging CPython applications (especially desktop-based ones).

    The following subjects will be covered:

    • Debugging of memory/resource leaks (circular references, __del__, weakref, garbage collector, etc.). We will show in details how the memory management of Python objects work and we will show a few tricks to track memory leaks
    • Python code profiling (profile/hotshots/cProfile, design of small tests, etc.). We will show how to measure, profile, and analyse an application to spot performance problems and solve them.
    • Post-mortem step-by-step debugging of C/C++ extension under Windows. We will show how to setup Visual Studio for debugging, how to see a traceback in case of an unexpected segfault, and how to further debug and solve the crash.

    This talk is aimed at intermediate Python programmers, who have already developed non-trivial Python applications but have never "jumped through" the interpreter abstraction layer. If you feel a little lost when you see a segfault from a Python program or you don't have a clear idea how memory is collected in Python, this talk is perfect for you.

    At 9:00am to 10:30am, Wednesday 22nd June

    Coverage video

Thursday 23rd June 2011

  • Combining Embedded and Interactive Python in a Debugger: A Case Study

    by Caroline Tice

    LLDB is an open source compiler currently under development. LLDB
    incorporates Python in several different ways: From the command line,
    one can drop into an interactive Python script interpreter, entering
    normal Python interactive commands and having them interpreted and
    executed. In addition, the LLDB debugger has a programming API that
    allows users to call actual debugger functions and access real
    debugger objects. This API is run through SWIG and converted into a
    Python module that gets automatically imported into the interactive
    interpreter inside LLDB. The upshot of this is that, in the Python
    mode, users can call the API functions as if they were regular Python
    functions. This is turn means that users can do things like hit a
    breakpoint, call the appropriate API functions to get the actual
    current frame object, check to see if the caller function several
    frames up the stack is a particular function, and if so, perform some
    other interesting action. LLDB also allows for breakpoint commands to
    be written in Python (which therefore allows them to call the API
    functions), as well as having acommandthat interpretsand executes a
    single line of Python.

    Becausethe APIand allof the debuggerfunctionality is available in
    a Python module, it is also possible to write a debugger front end
    completely in Python and have it import the LLDB module and call the
    LLDB API functions (which calls into the LLDB shared library), to
    create a new debugger front end. Our test suite takes advantage of
    this to run tests on the LLDB library without having to start up an
    interactive LLDB debubgger session.

    There were manyinteresting problems encountered and overcome in
    getting all of this to work. LLDB combines both interactive Python
    and embedded Python. There were some interesting things worked out so
    thata single Pythonenvironment dictionary is used for the entire
    debugger session: A user can pop into and out of the interactive
    interpreter and have access at any time to anything defined in any
    previous visit to the interactive interpreter (within the same debug
    session); breakpoint commands have access to everything defined in the
    interactive session; so do embedded script commands. It gets even
    more complicated, because LLDB can have multiple debugger sessions
    alive at once, and each debugger session has its own Python
    interpreter with its own dictionary and must not be allowed to
    interfere with another session's state. In this talk I will discuss
    how we implemented many of these features in LLDB, pointing out some
    of the more interesting problems we encountered and how we overcame
    them, and demonstrate it all working inLLDB.

    At 11:15am to 12:15pm, Thursday 23rd June

    Coverage video

Schedule incomplete?

Add a new session

Filter by Day

Filter by coverage

Filter by Topic