From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] Implement new features needed for handling SystemTap probes
Date: Mon, 12 Mar 2012 23:15:00 -0000 [thread overview]
Message-ID: <20120312231514.GA10376@host2.jankratochvil.net> (raw)
In-Reply-To: <87obs1o8ry.fsf@fleche.redhat.com>
On Mon, 12 Mar 2012 21:37:37 +0100, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
[...]
> Jan> I believe there was intended some abstraction, more talked about it
> Jan> elsewhere, breakpoint.c should only include some (nonexistent)
> Jan> "probe.h", not "stap-probe.h".
>
> What did you have in mind?
>
> In the abstract, my concern about adding abstraction is that we aren't
> sure it would be good for anything. Then we can wind up with an
> over-engineered solution.
>
> But, this is an abstract concern; perhaps your idea is not susceptible
> to this.
I find important that user interface gets established in a way needing no
changes in the future, as discussed with Eli.
Including probe.h vs. stap-probe.h also seems more easier for readability of
the generic GDB code. So called code encapsulation - not to complicate
unrelated code with the specific stap backend details visibility.
It would also make it more easy to implement breakpoints on UST addresses;
although I do not have ust.h available here to examine that possibility more.
> Jan> Here you leak PROV_PAT, PROBE_PAT and OBJ_PAT.
>
> No, compile_rx_or_error makes a cleanup.
Yes but there is:
discard_cleanups (cleanup);
which discards those cleanups.
IMO that discard_cleanups was meant for RESULT but not for PROV_PAT, PROBE_PAT
and OBJ_PAT - or I really still miss it? There should be two cleanup trackers:
cleanup = make_cleanup (VEC_cleanup (stap_entry), &result);
cleanup_temps = compile_rx_or_error (&prov_pat, provider, _("Invalid provider regexp"));
compile_rx_or_error (&probe_pat, probe, _("Invalid probe regexp"));
compile_rx_or_error (&obj_pat, objname, _("Invalid object file regexp"));
[...]
do_cleanups (cleanup_temps);
discard_cleanups (cleanup);
> Jan> Moreover I would still more see to drop [patch 1/3], call just
> Jan> compute_probe_arg which returns lazy lval_computed struct value *
> Jan> which provides new struct lval_funcs member which can return
> Jan> `struct expression *' and generic code can call gen_expr on its
> Jan> own. There is no need for special
> Jan> internalvar_funcs-> compile_to_ax member.
[...]
> Putting this into lval_funcs seems very roundabout to me. First, it
> means computing a value in the middle of compiling to AX. But, when
> compiling to AX we are not generally computing values.
+
> Simply asking the internalvar for an expression is simpler all around.
lval_computed value is not a real value, it is just a way how to implement the
needed functionality on top of existing API, without needing making that API
more rich.
I do not mind if you have considered the lval_computed way.
> We could change the new method to return an expression; this doesn't
> seem vital to me since it isn't used anywhere else, but I find it a
> valid aesthetic choice.
That's already detail, I was objecting more the whole [patch 1/3].
Thanks,
Jan
next prev parent reply other threads:[~2012-03-12 23:15 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-09 20:29 [PATCH 0/3] Implement support for SystemTap probes on userspace Sergio Durigan Junior
2012-03-09 20:32 ` [PATCH 1/3] Refactor internal variable mechanism Sergio Durigan Junior
2012-03-09 21:03 ` Tom Tromey
2012-03-10 4:02 ` Sergio Durigan Junior
2012-03-09 20:34 ` [PATCH 2/3] Implement new features needed for handling SystemTap probes Sergio Durigan Junior
2012-03-10 8:38 ` Eli Zaretskii
2012-03-10 16:56 ` Mark Kettenis
2012-03-12 15:11 ` Tom Tromey
2012-03-13 8:58 ` Mark Kettenis
2012-03-13 16:06 ` Sergio Durigan Junior
2012-03-15 20:44 ` Tom Tromey
2012-03-16 14:52 ` Mark Kettenis
2012-03-16 18:17 ` Tom Tromey
2012-03-10 19:22 ` Jan Kratochvil
2012-03-12 20:37 ` Tom Tromey
2012-03-12 23:15 ` Jan Kratochvil [this message]
2012-03-15 15:40 ` Pedro Alves
2012-03-15 15:36 ` Pedro Alves
2012-03-15 20:50 ` Tom Tromey
2012-03-09 20:34 ` [PATCH 3/3] Use longjmp and exception probes when available Sergio Durigan Junior
2012-03-09 21:15 ` [PATCH 0/3] Implement support for SystemTap probes on userspace Tom Tromey
2012-03-10 3:51 ` Sergio Durigan Junior
2012-03-10 7:55 ` Eli Zaretskii
2012-03-10 8:55 ` Jan Kratochvil
2012-03-10 9:06 ` Eli Zaretskii
2012-03-10 15:52 ` Sergio Durigan Junior
2012-03-12 19:59 ` Tom Tromey
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=20120312231514.GA10376@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
--cc=tromey@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