Edgewall Software

Changes between Version 16 and Version 17 of TracTroubleshooting


Ignore:
Timestamp:
Jan 19, 2016, 2:20:07 PM (8 years ago)
Author:
figaro
Comment:

Further cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracTroubleshooting

    v16 v17  
    4242Now, before describing the specific debugging techniques you can use, a basic understanding of Trac's architecture is needed.
    4343
    44 Trac uses a [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller model-view-controller approach]. The ''controller'' is a Python class called a "module" which inherits from the Component class and implements the `IRequestHandler` interface. A ''Component'' is the basic building block in the TracDev/ComponentArchitecture, it ''implements'' some ''Interface''s. The controller reacts on user requests and prepares the data that will be used by a template engine to fill the adequate template, in order to render the ''view'' which will be sent back to the user.
     44Trac uses a [http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller model-view-controller approach]. The ''controller'' is a Python class called a "module" which inherits from the Component class and implements the `IRequestHandler` interface. A ''Component'' is the basic building block in the TracDev/ComponentArchitecture, it ''implements'' some ''Interface''s. The controller reacts on user requests and prepares the data that will be used by a template engine to fill the adequate template, in order to render the ''view'' which is sent back to the user.
    4545
    4646The TracDev collection of development guides can be useful here.
     
    9797You should be able to issue interesting commands like `pystack`, `pyframe`, `pylocals`, etc.
    9898
    99 If you are using a gdb 7.x version built "`--with-python`", you can instead "`source`" [http://hg.python.org/cpython/file/2.7/Tools/gdb/libpython.py  libpython.py] and use `py-bt` (see also [http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html Scripting gdb using Python]).
     99If you are using a gdb 7.x version built `--with-python`, you can instead `source` [http://hg.python.org/cpython/file/2.7/Tools/gdb/libpython.py libpython.py] and use `py-bt`. See also [http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html Scripting gdb using Python].
    100100
    101101==== Debugging Segmentation Faults
     
    106106(gdb) run /opt/trac-0.10/scripts/tracd -p 8080 /srv/trac/yourproject
    107107}}}
     108
    108109Of course, adapt the paths and the options to match what is relevant for you.
    109110
     
    115116}}}
    116117
    117 When it crashes, do "`bt`" in order to get a full backtrace.
    118 Another very useful command is "`info shared`", which gives you a list of the shared libraries actually used.
     118When it crashes, do `bt` in order to get a full backtrace.
     119Another very useful command is `info shared`, which gives you a list of the shared libraries actually used.
    119120
    120121==== Debugging a Hanging Process