From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74436 invoked by alias); 27 Jun 2017 11:17:26 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 74393 invoked by uid 89); 27 Jun 2017 11:17:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Jun 2017 11:17:24 +0000 Received: by mail-wm0-f41.google.com with SMTP id b184so23155522wme.1 for ; Tue, 27 Jun 2017 04:17:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VEXOejxc9ExxKl7QmNvosCLQgfhilqhGSbp0P2skVZs=; b=TnJei4Kaj0LzrW4YP19+MgkPEjptSMdLKkd6x0DY70qv8HB9gdXdoAs5m8Ju32jyT5 SHm0KTIbgRSmw13eM9MXc044O0OGoDw586h7vVnaeg5tsceNwwBsoRVYBw7gIksAimWQ UEQloHaePPj+enOgc1C0pO3m9iSSUpG2XuAvYMmQQ8M2rOJB417Fek0o+v3HUlkoe+Oa dm5eDtNolndXHx2BzzIbgD8zVxIsIIKGo14absNecVkmwyDIrGEwl4B5wfC3ipKeR182 sgisc2UpYENWp2fSOQiiyqUDaBrd7Y8NtA7CFHOpn7mhJaP5L8eE7vh9YrteuWkjPuAL 0uvg== X-Gm-Message-State: AKS2vOyjGctvffSFp04yFQoLGdKIzQBTnRCuevWooAIeCdmZPBmqiN/Z C6M2xlkwYvQBztQYuGnYuPE+50NCVw== X-Received: by 10.80.184.129 with SMTP id l1mr3585935ede.88.1498562242641; Tue, 27 Jun 2017 04:17:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.164.185 with HTTP; Tue, 27 Jun 2017 04:17:22 -0700 (PDT) In-Reply-To: <570ff52f-214b-98a4-dcc0-74d134c67c3d@redhat.com> References: <570ff52f-214b-98a4-dcc0-74d134c67c3d@redhat.com> From: Matt Rice Date: Tue, 27 Jun 2017 11:17:00 -0000 Message-ID: Subject: Re: Python Symbol API question/weirdness To: Pedro Alves Cc: Evan Driscoll , GDB Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00033.txt.bz2 On Tue, Jun 27, 2017 at 3:56 AM, Pedro Alves wrote: > On 06/16/2017 09:55 PM, Evan Driscoll wrote: > >> Does anyone have any idea what might be going on? I think I don't >> actually need this to work, but I am curious what is going on. Maybe >> something with symbol aliases? > > I think that you're seeing this because the Python API is only aware > of debug info symbols, while "raise" etc. above in your examples > are minimal symbols (i.e., elf symbols), as hinted by: > > $2 = ( *) 0x7ffff7a433f0 <__GI_raise> > ^^^^^^^^^^^^^ > > Sounds like exposing minsyms to the Python layer would be useful. > I'm actually surprised it doesn't already expose them somehow. I think you can get some information about minsyms from decode_line (gdb) py print(gdb.parse_and_eval("main")) {} 0x4004f0
(gdb) py print('%02x' % gdb.decode_line("main")[1][0].pc) 4004f0