|
|
|
|
|
Debugging and Optimising |
|
The hope is that this page will develop into one covering the using of
debugging tools including leak checkers and performance analysers. Also see Understanding Error Messages, Brett's talk on gdb and Mike's talk on Valgrind Hardware watchpoints in gdbFrom Brett: As talked about at the meeting I dug up an old email to George about using hardware watchpoints to watch for when a variable changes.To do this, the variable must be less than 16 bytes (on x86 hardware), so if you are looking at a struct or a class, just choose one member. I think there is also a limit on the number of hardware watchpoints allowed (4?). Here is an example usage for looking at a member of a CINT global structure: shell> gdb loon ... (gdb) b main ... (gdb) r ... (gdb) awatch G__definedtemplateclass.next Hardware access (read/write) watchpoint 2: G__definedtemplateclass.next (gdb) c Continuing. Hardware access (read/write) watchpoint 2: G__definedtemplateclass.next Old value = (struct G__Definedtemplateclass *) 0x889a790 New value = (struct G__Definedtemplateclass *) 0x889a720 0x4265ed80 in strcpy () from /lib/libc.so.6 (gdb) where #0 0x4265ed80 in strcpy () from /lib/libc.so.6 ... Jim Kowalkowski's profilerFrom Brett: the documentation for Jim Kowalkowski's profiler and my wrapper to run it and analyze the output is now committed and online at:http://minos.phy.bnl.gov/software/prof/PerfTools/doc/ This describes how it works and how to install and run it. It includes a walk through tutorial, including screenshots. It uses an example that, while admittedly contrived, has qualitatively the same features that were found in the DeMux improvements. Leak CheckersWe use several leak checkers including Valgrind and MemCheck.Message Service OutputIf all else fails, there is alway the humble debug print! The Message Service, used by our software, allows the job user to control the level of output, from any module or framework service, at execution time. It also contains a Trip Wire Debug Facility that can globally control all output. See the Message Service chapter of the User Manual for details. |
| Security, Privacy, Legal |
|