From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1454 invoked by alias); 17 Jun 2014 19:24:52 -0000 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 Received: (qmail 1436 invoked by uid 89); 17 Jun 2014 19:24:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f173.google.com Received: from mail-ve0-f173.google.com (HELO mail-ve0-f173.google.com) (209.85.128.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 17 Jun 2014 19:24:50 +0000 Received: by mail-ve0-f173.google.com with SMTP id db11so7958314veb.4 for ; Tue, 17 Jun 2014 12:24:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=+d7dPld4fePitvsOJiEmC1gCGi04WW0j6CDpcbE9ciw=; b=ddRYxNauVCr82vRaN+PUZ2k1bzPwvTI607U+ESHHcRAyh1aavkn2Owi3hLNKq80L12 uc8oy70nwQrYgSSB50/uziV2U06NDw4Pg9C1oblTqDqkiDbz62vvRdR1vCEWAQdIVPFC 4wVWvHwbEdc7tQvJA1xtav0ftXmcv3DyZ4WB1vApY2r7nD7cWUc2h2oF9j11TS0LQBQo IroLrncd3FcTpNGeg4KnUhK34XAtiD6y35m4rlFZKWC2GK2ZNZ9uJQrVZur14v8jilEo OWbPWGKX95vySmG+D2JfI83vMRNDPmaD6o8DuEjQmvtxZNQteEaV13RJNf1h8sUqWVNb XAcg== X-Gm-Message-State: ALoCoQkXaDUU8wyvBx0LKz2nnv26qDLKWb+YuK5yMaWdFYt3rcVKCZABWOckHCka9eXonXLAJclq MIME-Version: 1.0 X-Received: by 10.58.69.76 with SMTP id c12mr3158257veu.35.1403033088065; Tue, 17 Jun 2014 12:24:48 -0700 (PDT) Received: by 10.52.28.230 with HTTP; Tue, 17 Jun 2014 12:24:47 -0700 (PDT) In-Reply-To: References: <1403022790-16464-1-git-send-email-tromey@redhat.com> Date: Tue, 17 Jun 2014 19:24:00 -0000 Message-ID: Subject: Re: [PATCH] add more methods to gdb.Progspace From: Doug Evans To: Tom Tromey Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00638.txt.bz2 On Tue, Jun 17, 2014 at 8:14 PM, Doug Evans wrote: > On Tue, Jun 17, 2014 at 6:33 PM, Tom Tromey wrote: >> There are a number of global functions in the gdb Python module which >> really should be methods on Progspace. This patch adds new methods to >> Progspace and then redefines these globals in terms of these new >> methods. It also adds an Inferior.progspace attribute so that the >> association between inferiors and progspaces is obvious; this lets us >> apply the same treatment to current_progspace. >> > [...] > Hi. A few comments inline. > > solib_name(pc) > > This doesn't feel right as an element of the API. > What if pc is in the main executable? Can't the answer be found via > other means? > We've exported objfiles, so what does this bring to the table that, > say, objfile_name (pc) doesn't? > Or even better(?), symtab_and_line(pc) is all that's really needed, isn't it? > [since one can, I think, get the objfile from the symtab; and if not > we should provide that] I guess a pc could be found that is in an objfile, and not in a symtab, so symtab_and_line(pc) can be insufficient. But that still leaves objfile_for_pc (pc), or some such. If the user wants the name s/he can get it from the objfile. > [Maybe there is a compelling reason to have it that I'm not seeing though.] Still holds of course.