This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb remote protocol breakpoints (Z0 command)


Yao Qi <yao@codesourcery.com> wrote:

> If you don't require much interactive operations, tracepoint is a better
> choice, IMO.

Actually, we use tracepoints quite extensively.

Both our old and our new stubs support tracepoints; our use of
tracepoints preceeds GDB support for tracepoints.

My first use of function calling at a breapoint goes back more than a
decade.  I've used it for things like setting a breakpoint on a
troublesome functions and then creating a command list like --

    print that the function was called and its arguments; for
    structures, possibly print key elements of the structure

    print interesting global variables

    print a backtrace

    disable the current breakpoint

    set $retval = <current function>(<current arguments>)

    print return value

    re-enable breakpoint

    return $retval

    continue

So, we end up with the function arguments, the return value, and
selected other interesting information each time the function is called.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]