From patchwork Fri Jun 26 13:49:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 7389 Received: (qmail 4574 invoked by alias); 26 Jun 2015 13:49:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 4495 invoked by uid 89); 26 Jun 2015 13:49:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 26 Jun 2015 13:49:12 +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 (Postfix) with ESMTPS id 8C02F389D9C; Fri, 26 Jun 2015 13:49:11 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5QDn75S000776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 26 Jun 2015 09:49:10 -0400 Date: Fri, 26 Jun 2015 15:49:07 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Clem Dickey , Jonathan Wakely Subject: [patch] Fix 'info type-printers' Python error - PR 17136 Message-ID: <20150626134907.GA23742@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, by Clem Dickey and Jonathan Wakely: https://bugzilla.redhat.com/show_bug.cgi?id=1085576 https://sourceware.org/bugzilla/show_bug.cgi?id=17136 if you debug any program then register the type printer with the current objfile, running 'info type-printers' results in a python exception: (gdb) info type-printers Python Exception 'gdb.Objfile' object has no attribute 'name': Error occurred in Python command: 'gdb.Objfile' object has no attribute 'name' -> (gdb) info type-printers Type printers for /lib64/libstdc++.so.6: basic_string_view deque ... unordered_set vector The exception doesn't happen if the type printer is registered globally, by passing None instead of gdb.current_objfile(). Doug: https://sourceware.org/bugzilla/show_bug.cgi?id=17136#c6 The patch can be checked in IMO. Given that I don't have the time to write a testcase myself I'm not going to force someone else to. Another reviewer may require one though. Jan 2015-06-26 Clem Dickey Fix 'info type-printers' Python error. * python/lib/gdb/command/type_printers.py (InfoTypePrinter): Fix typo. diff --git a/gdb/python/lib/gdb/command/type_printers.py b/gdb/python/lib/gdb/command/type_printers.py index 0ef7686..1203989 100644 --- a/gdb/python/lib/gdb/command/type_printers.py +++ b/gdb/python/lib/gdb/command/type_printers.py @@ -47,7 +47,7 @@ class InfoTypePrinter(gdb.Command): sep = '' for objfile in gdb.objfiles(): if objfile.type_printers: - print ("%sType printers for %s:" % (sep, objfile.name)) + print ("%sType printers for %s:" % (sep, objfile.filename)) self.list_type_printers(objfile.type_printers) sep = '\n' if gdb.current_progspace().type_printers: