From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA 3/4] Improved linker-debugger interface
Date: Tue, 17 Jul 2012 21:57:00 -0000 [thread overview]
Message-ID: <20120717215641.GA10049@host2.jankratochvil.net> (raw)
In-Reply-To: <20120712123554.GD29236@redhat.com>
On Thu, 12 Jul 2012 14:35:54 +0200, Gary Benson wrote:
> --- a/gdb/probe.h
> +++ b/gdb/probe.h
> @@ -210,6 +210,17 @@ extern void info_probes_for_ops (char *arg, int from_tty,
>
> extern struct cmd_list_element **info_probes_cmdlist_get (void);
>
> +/* Return the argument count of the specified probe. */
/* OBJFILE must be known to have probes support. */
> +
> +extern unsigned get_probe_argument_count (struct objfile *objfile,
> + struct probe *probe);
> +
> +/* Evaluate argument N of the specified probe. */
/* OBJFILE must be known to have probes support. N must be between
0 inclusive and get_probe_argument_count exclusive. */
> +
> +extern struct value *evaluate_probe_argument (struct objfile *objfile,
> + struct probe *probe,
> + unsigned n);
> +
> /* A convenience function that finds a probe at the PC in FRAME and
> evaluates argument N, with 0 <= N < number_of_args. If there is no
> probe at that location, or if the probe does not have enough arguments,
> diff --git a/gdb/probe.c b/gdb/probe.c
> index 77f3b13..a61f4ea 100644
> --- a/gdb/probe.c
> +++ b/gdb/probe.c
> @@ -658,6 +658,30 @@ info_probes_command (char *arg, int from_tty)
>
> /* See comments in probe.h. */
>
> +unsigned
> +get_probe_argument_count (struct objfile *objfile, struct probe *probe)
> +{
> + gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
> +
> + return objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
> + probe);
> +}
> +
> +/* See comments in probe.h. */
> +
> +struct value *
> +evaluate_probe_argument (struct objfile *objfile, struct probe *probe,
> + unsigned n)
> +{
> + gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
> +
> + return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
> + probe,
> + n);
probe and n can be on single line, it is 76 columns [yes, it is copy-paste].
> +}
> +
> +/* See comments in probe.h. */
> +
> struct value *
> probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
> {
> @@ -668,17 +692,12 @@ probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
> probe = find_probe_by_pc (get_frame_pc (frame), &objfile);
> if (!probe)
> return NULL;
> - gdb_assert (objfile->sf && objfile->sf->sym_probe_fns);
>
> - n_probes
> - = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile,
> - probe);
> + n_probes = get_probe_argument_count (objfile, probe);
> if (n >= n_probes)
> return NULL;
>
> - return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile,
> - probe,
> - n);
> + return evaluate_probe_argument (objfile, probe, n);
> }
>
> /* See comment in probe.h. */
It is pre-approved but please do not check it in without any use, only with
some other patch depending on it.
Thanks,
Jan
next prev parent reply other threads:[~2012-07-17 21:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-12 12:34 [RFA 0/4] " Gary Benson
2012-07-12 12:35 ` [RFA 1/4] " Gary Benson
2012-07-12 12:36 ` [RFA 3/4] " Gary Benson
2012-07-17 18:01 ` Sergio Durigan Junior
2012-07-17 21:57 ` Jan Kratochvil [this message]
2012-07-17 23:42 ` Sergio Durigan Junior
2012-07-18 7:02 ` Jan Kratochvil
2012-07-18 10:36 ` Gary Benson
2012-07-19 14:36 ` Gary Benson
2012-07-12 12:36 ` [RFA 2/4] " Gary Benson
2012-07-13 9:41 ` Gary Benson
2012-07-12 12:36 ` [RFA 4/4] " Gary Benson
2012-07-13 9:42 ` Gary Benson
2012-07-13 12:20 ` Gary Benson
2012-07-17 18:11 ` Sergio Durigan Junior
2012-07-18 14:28 ` Jan Kratochvil
2012-07-18 15:11 ` Sergio Durigan Junior
2012-07-19 14:38 ` Gary Benson
2012-07-18 14:08 ` [RFA 0/4] " Gary Benson
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=20120717215641.GA10049@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
/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