From: PAUL GILLIAM <pgilliam@us.ibm.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: drow@false.org, Auslieferator@gmx.net, gdb@sources.redhat.com
Subject: Re: conditional breakpoint with (char* ) string condition
Date: Sat, 13 May 2006 11:24:00 -0000 [thread overview]
Message-ID: <1147456548.3672.78.camel@dufur.beaverton.ibm.com> (raw)
In-Reply-To: <ufyjf6r0d.fsf@gnu.org>
On Fri, 2006-05-12 at 21:24 +0300, Eli Zaretskii wrote:
> > From: PAUL GILLIAM <pgilliam@us.ibm.com>
> > Cc: Eli Zaretskii <eliz@gnu.org>, Fabio De Bona <Auslieferator@gmx.net>,
> > gdb@sources.redhat.com
> > Date: Fri, 12 May 2006 08:05:32 -0700
> >
> > How about strlen as well?
>
> Where would it be useful?
Here is an admittedly contrived example. Say we had a target program
that was writing a 'progress meter' to stderr with the following code:
void progress_tick (buf)
{
void strcat (buf, ".");
fprintf (stderr, "\r%s", buf);
}
main ()
{
char progress[1024] = { 0 };
. . .
while ( ! done)
{
progress_tick (progress);
real_work ();
}
return 0;
}
Then in GDB you could do this:
start
b real_work if $_strlen(progress) >= 5
Yes, this example might not be 'real world', but strlen just seems to go
with strcmp.
-=# Paul #=-
prev parent reply other threads:[~2006-05-12 18:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-12 12:43 Fabio De Bona
2006-05-12 12:45 ` Eli Zaretskii
2006-05-12 13:53 ` Daniel Jacobowitz
2006-05-12 16:09 ` Eli Zaretskii
2006-05-12 16:21 ` Daniel Jacobowitz
2006-05-12 18:00 ` PAUL GILLIAM
2006-05-12 18:59 ` Jim Blandy
2006-05-15 17:55 ` Daniel Jacobowitz
2006-05-15 19:17 ` Jim Blandy
2006-05-15 19:51 ` Daniel Jacobowitz
2006-05-15 22:44 ` Jim Blandy
2006-05-16 12:39 ` Joel Brobecker
2006-05-12 20:36 ` Eli Zaretskii
2006-05-13 11:24 ` PAUL GILLIAM [this message]
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=1147456548.3672.78.camel@dufur.beaverton.ibm.com \
--to=pgilliam@us.ibm.com \
--cc=Auslieferator@gmx.net \
--cc=drow@false.org \
--cc=eliz@gnu.org \
--cc=gdb@sources.redhat.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