Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: toddpw@wrs.com (Todd Whitesel)
To: James.C.Thompson@USAHQ.UnitedSpaceAlliance.com (Thompson, James C)
Cc: gdb@cygnus.com
Subject: Re: problem with chained if statements?
Date: Thu, 01 Apr 1999 00:00:00 -0000	[thread overview]
Message-ID: <199903182257.OAA00591@alabama.wrs.com> (raw)
In-Reply-To: <FF2855070F62D211910F00805FA7BBFF195B87@USAHOUM8>

> But I think the real power would be to add hooks into gdb at various places
> to which guile scripts can be attached.  Breakpoints, for example: if I
> could tell gdb to run a guile script each time a breakpoint is encountered,
> then I could do "conditional debugging" by letting the script examine the
> inferior program state so that execution pauses only when certain criteria
> are met.  Of course, it's possible to accomplish the same thing by building
> special debug code into the executable, but that's invasive and
> time-consuming -- best case, I have to recompile my program.  The ability to
> set up and change these hooks on the fly would be very nice.

Um, gdb already lets you do this, subject to the limitations of the gdb
command language and variable facilities.

(gdb) help command
Set commands to be executed when a breakpoint is hit.
Give breakpoint number as argument after "commands".
With no argument, the targeted breakpoint is the last one set.
The commands themselves follow starting on the next line.
Type a line containing "end" to indicate the end of them.
Give "silent" as the first line to make the breakpoint silent;
then no output is printed when it is hit, except what the commands print.

-- 
Todd Whitesel
toddpw @ wrs.com


  reply	other threads:[~1999-04-01  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-01  0:00 Thompson, James C
1999-04-01  0:00 ` Todd Whitesel [this message]
1999-04-01  0:00 ` Ovidiu Predescu
1999-04-01  0:00   ` Stan Shebs
  -- strict thread matches above, loose matches on Subject: below --
1999-04-01  0:00 J.T. Conklin
1999-04-01  0:00 ` Stan Shebs
1999-04-01  0:00   ` J.T. Conklin
1999-04-01  0:00     ` Stan Shebs
1999-04-01  0:00 Thompson, James C

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199903182257.OAA00591@alabama.wrs.com \
    --to=toddpw@wrs.com \
    --cc=James.C.Thompson@USAHQ.UnitedSpaceAlliance.com \
    --cc=gdb@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox