Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Fabio De Bona <Auslieferator@gmx.net>, Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: conditional breakpoint with (char* ) string condition
Date: Fri, 12 May 2006 13:53:00 -0000	[thread overview]
Message-ID: <20060512124527.GB3460@nevyn.them.org> (raw)
In-Reply-To: <uy7x77akz.fsf@gnu.org> <44645774.8060503@gmx.net>

On Fri, May 12, 2006 at 11:37:56AM +0200, Fabio De Bona wrote:
> Hi everyone,
> I would like to set a conditional breakpoint with a condition that 
> depends on the value of
> a char* string, i.e. something like
> 
> b gui/R.cpp:190 if cmd=="train" (doesn't work of course)
> 
> resp.
> 
> b gui/R.cpp:190 if strcmp(cmd,"train")

This should actually work - although it's a bit slow to implement.

On Fri, May 12, 2006 at 02:21:16PM +0300, Eli Zaretskii wrote:
> > Date: Fri, 12 May 2006 11:37:56 +0200
> > From: Fabio De Bona <Auslieferator@gmx.net>
> > 
> > b gui/R.cpp:190 if cmd=="train" (doesn't work of course)
> 
> But this should:
> 
>   b gui/R.cpp:190 if cmd[0]=='t' && cmd[1]=='r' && cmd[2]=='a' && cmd[3]=='i'
> 
> etc., you get the point.

I wonder.  Should we add some common builtin functions to GDB?

  b gui/R.cpp:190 if $gdb_strcmp (cmd, "train")

[This might be quite a lot of work, since right now parsing "train"
will cause us to malloc() in the program.]

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2006-05-12 12:45 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 [this message]
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

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=20060512124527.GB3460@nevyn.them.org \
    --to=drow@false.org \
    --cc=Auslieferator@gmx.net \
    --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