RTFC.org.uk

Kev Sheldrake

Home

Bps - Breakpoint Shenanigans

Download

Tool: bps.0.4.tgz | bps.0.3.tgz
Slides: bps.0.3.pdf

Overview

The idea is to automate some of the things I use gdb for, namely repeatedly breaking on certain addresses and displaying the contents of registers and memory locations, and automatically continuing.

Breakpoints can be specified as either addresses or function names; display information can be contents of registers, or the contents of buffers pointed to by addresses or registers, with offsets. Buffers need to have the format specified - b(ytes), h(alfwords), w(ords), s(tring); size (not for string); and an optional offset. For each breakpoint you can specify the maximum number of times to break on it. You can also specify a function or address to hit before enabling the breakpoints.

If a count is specified for a breakpoint, then it will trigger any specified actions after the specified number of times that breakpoint is hit; the breakpoint will then be disabled. If a count is not specified, then the breakpoint will trigger any specified actions every time the breakpoint is hit.

Breakpoint actions are: enable or disable any number of breakpoints, including itself (by 1-indexed count of breakpoints in the order specified on the command line); kill the process that triggered the breakpoint; and enable or disable copy of breakpoints on fork or thread creation. Breakpoint actions that enable or disable breakpoints can either be local or global, meaning they affect either the current process or thread or they affect all processes and threads.

Program output defaults to stdout, but can be redirected to either stderr or a named pipe.

Supported platforms

Expecting it to work on any other platforms is very optimistic of you.
MIPS port in the pipeline.





        888     .d888                      888                .d8888888b.                                       d8b 888                                    
        888    d88P"                       888               d88P"   "Y88b                                      Y8P 888                                    
        888    888                         888               888  d8b  888                                          888                                    
888d888 888888 888888 .d8888b .d88b.   .d88888  .d88b.       888  888  888       .d88b.  88888b.d88b.   8888b.  888 888      .d8888b .d88b.  88888b.d88b.  
888P"   888    888   d88P"   d88""88b d88" 888 d8P  Y8b      888  888bd88P      d88P"88b 888 "888 "88b     "88b 888 888     d88P"   d88""88b 888 "888 "88b 
888     888    888   888     888  888 888  888 88888888      888  Y8888P"       888  888 888  888  888 .d888888 888 888     888     888  888 888  888  888 
888     Y88b.  888   Y88b.   Y88..88P Y88b 888 Y8b.          Y88b.     .d8      Y88b 888 888  888  888 888  888 888 888 d8b Y88b.   Y88..88P 888  888  888 
888      "Y888 888    "Y8888P "Y88P"   "Y88888  "Y8888        "Y88888888P"       "Y88888 888  888  888 "Y888888 888 888 Y8P  "Y8888P "Y88P"  888  888  888 
                                                                                     888                                                                   
                                                                                Y8b d88P                                                                   
                                                                                 "Y88P"