public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/17136] 'info type-printers' causes an exception when there are per-objfile printers
Date: Fri, 29 May 2015 12:06:00 -0000	[thread overview]
Message-ID: <bug-17136-4717-eC8zVrMkqk@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17136-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=17136

--- Comment #2 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
Keith, sorry for not replying to your question, not sure why I didn't see it.

I still see this in Fedora 22 with: GNU gdb (GDB) Fedora 7.9.1-13.fc22

tmp$ cat > p.cc
int main() {
return 0;                                                                    
}
tmp$ 
tmp$ 
tmp$ g++ -g p.cc
tmp$ gdb a.out
GNU gdb (GDB) Fedora 7.9.1-13.fc22
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...done.
(gdb) python
>class Printer(object):
>  def __init__ (self):
>    self.name = 'Printer'
>    self.enabled = True
>
>  class _recognizer(object):
>    def recognize(self, type_obj):
>      if type_obj.tag == "Foo":
>        return "Bar"
>      return None
>
>  def instantiate(self):
>    return self._recognizer()
>end
(gdb) start
Temporary breakpoint 1 at 0x4005ba: file p.cc, line 2.
Starting program: /tmp/a.out 
Missing separate debuginfos, use: dnf debuginfo-install
glibc-2.21-5.fc22.x86_64

Temporary breakpoint 1, main () at p.cc:2
2       return 0;
Missing separate debuginfos, use: dnf debuginfo-install
libgcc-5.1.1-1.fc22.x86_64 libstdc++-5.1.1-1.fc22.x86_64
(gdb) python gdb.types.register_type_printer(gdb.current_objfile(), Printer())
(gdb) info type-printers
Python Exception <class 'AttributeError'> 'gdb.Objfile' object has no attribute
'name': 
Error occurred in Python command: 'gdb.Objfile' object has no attribute 'name'
(gdb)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2015-05-29 12:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 12:08 [Bug python/17136] New: " jwakely.gcc at gmail dot com
2014-07-22 18:27 ` [Bug python/17136] " jan.kratochvil at redhat dot com
2014-07-24 17:17 ` keiths at redhat dot com
2015-05-29 12:06 ` jwakely.gcc at gmail dot com [this message]
2015-05-29 12:11 ` jwakely.gcc at gmail dot com
2015-06-01 19:02 ` dje at google dot com
2015-06-01 19:13 ` dje at google dot com
2015-06-01 19:22 ` dje at google dot com
2015-06-26 13:49 ` jan.kratochvil at redhat dot com
2015-08-06 16:26 ` cvs-commit at gcc dot gnu.org
2015-08-06 16:30 ` cvs-commit at gcc dot gnu.org
2015-08-06 16:35 ` dje at google dot com
2023-03-13 13:41 ` cvs-commit at gcc dot gnu.org

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=bug-17136-4717-eC8zVrMkqk@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).