From: Tom Tromey <tromey@redhat.com>
To: Stan Shebs <stanshebs@earthlink.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] dynamic printf
Date: Wed, 14 Mar 2012 15:24:00 -0000 [thread overview]
Message-ID: <87haxrdx4f.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4F5FDD6B.3030507@earthlink.net> (Stan Shebs's message of "Tue, 13 Mar 2012 16:51:07 -0700")
>>>>> "Stan" == Stan Shebs <stanshebs@earthlink.net> writes:
Tom> I think you have to have a comma after the location. That is the only
Tom> reliable linespec terminator.
Stan> Hmmm. The format is a string though; would linespec parsing attempt
Stan> to proceed into that? How is "break <location> if foo" working these
Stan> days?
It is handled in multiple spots -- linespec.c:keep_name_info, but also
every language expression parser.
Probably linespec could be changed to make this syntax work, but I don't
see how the parsers could. E.g., the C parser will lex the printf
format string as a string token, then proceed to fail to parse, throwing
an exception.
That is, the case that breaks this is: dprintf *main "format".
This works, though, due to the fact that linespec uses
parse_to_comma_and_eval: dprintf *main, "format"
Stan> + struct agent_expr *cmd_bytecode;
Tom> Needs a comment.
Tom> Perhaps subclassing bp_location is also doable?
Stan> I'm not sure what you mean by this?
I thought it was possible to make a subclass of bp_location, arranging
for your breakpoint ops to override the appropriate allocation method.
Then only dprintf breakpoint locations would have the extra field.
I'm not totally sure, I haven't tried it.
Tom
prev parent reply other threads:[~2012-03-14 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 9:14 Stan Shebs
2012-02-29 10:28 ` Andreas Schwab
2012-03-13 23:09 ` Stan Shebs
2012-03-14 14:47 ` Marc Khouzam
2012-03-14 15:28 ` Tom Tromey
2012-02-29 16:16 ` Joel Brobecker
2012-03-13 23:15 ` Stan Shebs
2012-03-13 23:40 ` Joel Brobecker
2012-02-29 18:21 ` Eli Zaretskii
2012-03-13 23:20 ` Stan Shebs
2012-03-01 14:04 ` Hui Zhu
2012-03-04 6:31 ` Hui Zhu
2012-03-08 21:08 ` Tom Tromey
2012-03-13 23:51 ` Stan Shebs
2012-03-14 15:24 ` Tom Tromey [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=87haxrdx4f.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=stanshebs@earthlink.net \
/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