From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28997 invoked by alias); 7 May 2012 20:26:19 -0000 Received: (qmail 28986 invoked by uid 22791); 7 May 2012 20:26:17 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,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; Mon, 07 May 2012 20:25:59 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q47KPxSY025376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 7 May 2012 16:25:59 -0400 Received: from psique ([10.3.112.12]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q47KPtnj021215; Mon, 7 May 2012 16:25:57 -0400 From: Sergio Durigan Junior To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] Implement support for SystemTap probes References: <20120507193538.GA6283@host2.jankratochvil.net> <20120507195811.GA6969@host2.jankratochvil.net> X-URL: http://www.redhat.com Date: Mon, 07 May 2012 20:26:00 -0000 Message-ID: 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-05/txt/msg00198.txt.bz2 On Monday, May 07 2012, Jan Kratochvil wrote: > On Mon, 07 May 2012 21:53:49 +0200, Sergio Durigan Junior wrote: >> --- a/gdb/probe.c >> +++ b/gdb/probe.c >> @@ -303,6 +303,9 @@ collect_probes (char *objname, char *provider, char *probe_name, >> if (! objfile->sf || ! objfile->sf->sym_probe_fns) >> continue; >> >> + if (objfile->separate_debug_objfile_backlink != NULL) >> + continue; >> + > > I do not think it should be kind-unspecific. Different probe kind can be for > example present only in .debug files and not in the main binaries. > > Also I do not find great that it does not get displayed by `info probes' but > other commands still process even probes from .debug files. > > Couldn't you put this conditional rather into stap_get_probes? Here it is. I also removed a previous conditional that I had put in probes.c:parse_probes, because it is not needed at all. OK to apply? -- Sergio 2012-05-07 Sergio Duriga Junior * probe.c (parse_probes): Move conditional to check for debuginfo objfiles to... * stap-probe.c (stap_get_probes): ...here. diff --git a/gdb/probe.c b/gdb/probe.c index ee94f9c..77f3b13 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -120,9 +120,6 @@ parse_probes (char **argptr, struct linespec_result *canonical) && FILENAME_CMP (lbasename (objfile->name), objfile_name) != 0) continue; - if (objfile->separate_debug_objfile_backlink != NULL) - continue; - probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile); for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++) diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 273ae07..506e6c3 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -1411,6 +1411,12 @@ stap_get_probes (VEC (probe_p) **probesp, struct objfile *objfile) struct sdt_note *iter; unsigned save_probesp_len = VEC_length (probe_p, *probesp); + if (objfile->separate_debug_objfile_backlink != NULL) + { + /* This is a .debug file, not the objfile itself. */ + return; + } + if (!elf_tdata (obfd)->sdt_note_head) { /* There isn't any probe here. */