From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5983 invoked by alias); 17 Jul 2012 18:01:42 -0000 Received: (qmail 5973 invoked by uid 22791); 17 Jul 2012 18:01:40 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jul 2012 18:01:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6HI1KpM027358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 Jul 2012 14:01:20 -0400 Received: from psique (ovpn-113-52.phx2.redhat.com [10.3.113.52]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6HI1Imj023693 for ; Tue, 17 Jul 2012 14:01:19 -0400 From: Sergio Durigan Junior To: gdb-patches@sourceware.org Subject: Re: [RFA 3/4] Improved linker-debugger interface References: <20120712123554.GD29236@redhat.com> X-URL: http://www.redhat.com Date: Tue, 17 Jul 2012 18:01:00 -0000 In-Reply-To: <20120712123554.GD29236@redhat.com> (Gary Benson's message of "Thu, 12 Jul 2012 13:35:54 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00237.txt.bz2 On Thursday, July 12 2012, Gary Benson wrote: > This patch encapsulates part of the probes API which the final > patch in this series uses. I looked at your patch, and it seems OK to me. Thanks. > 2012-07-12 Gary Benson > > * probe.h (get_probe_argument_count): New declaration. > (evaluate_probe_argument): Likewise. > * probe.c (get_probe_argument_count): New function. > (evaluate_probe_argument): Likewise. > (probe_safe_evaluate_at_pc): Use the above new functions. > > diff --git a/gdb/probe.h b/gdb/probe.h > index 8d44ca2..1d29b87 100644 > --- 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. */ > + > +extern unsigned get_probe_argument_count (struct objfile *objfile, > + struct probe *probe); > + > +/* Evaluate argument N of the specified probe. */ > + > +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); > +} > + > +/* 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. */ -- Sergio