On Sep 14,  6:42pm, Benoit Hudson wrote:

> On Thu, Sep 14, 2000 at 01:06:47PM -0700, Kevin Buettner wrote:
> > other things too.  E.g, it might be okay if you added a hook which says
> > to run a user specified shell command every time gdb stops and
> > displays a prompt.  (I still don't know if such a patch would be
> > accepted, but it'd have a much better shot than one which has explicit
> > knowledge about the X Window system.)
> 
> Isn't that the 'commands' command?

No.  The 'commands' command is used to attach some commands to a
breakpoint.  They won't run the commands when single stepping or
gdb stops due to some signal.

But I found the following in the gdb manual:

    In addition, a pseudo-command, `stop' exists.  Defining
    (`hook-stop') makes the associated commands execute every time
    execution stops in your program:  before breakpoint commands are
    run, displays are printed, or the stack frame is printed.

Also, it's possible to run commands in the shell via the `shell'
command, so the original poster (Pierre) could put something like the
following in his .gdbinit file:

    define hook-stop
    shell clear_xgrab
    end

Provided that a suitable external program called `clear_xgrab' was
created, this would do what the original posted wanted.

(I still think it's better to use two machines to do this type of
debugging though.)

Kevin
_______________________________________________
Bug-gdb mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gdb

Reply via email to