From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Douglas Anderson Newsgroups: gmane.emacs.bugs Subject: bug#22657: 24.5; "Python Exception name 'long' is not defined" while using gdb registers buffer Date: Sun, 14 Feb 2016 12:22:47 -0700 Message-ID: References: <83fuwvz1wr.fsf@gnu.org> <8337svyxfl.fsf@gnu.org> Reply-To: douglas.j.anderson@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0116008e721ac3052bbfd42c X-Trace: ger.gmane.org 1455477864 31014 80.91.229.3 (14 Feb 2016 19:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 19:24:24 +0000 (UTC) Cc: 22657@debbugs.gnu.org To: immerrr again Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 14 20:24:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aV2HD-00087K-JJ for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 20:24:11 +0100 Original-Received: from localhost ([::1]:53093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2HC-0003Pz-R2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 14:24:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2H8-0003Ph-0z for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:24:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV2H3-0002R5-Uu for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:24:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV2H3-0002R0-Rl for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:24:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aV2H3-0005jz-NG for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 14:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Douglas Anderson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2016 19:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22657 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22657-submit@debbugs.gnu.org id=B22657.145547779422010 (code B ref 22657); Sun, 14 Feb 2016 19:24:01 +0000 Original-Received: (at 22657) by debbugs.gnu.org; 14 Feb 2016 19:23:14 +0000 Original-Received: from localhost ([127.0.0.1]:39058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV2GI-0005iw-94 for submit@debbugs.gnu.org; Sun, 14 Feb 2016 14:23:14 -0500 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:34416) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV2GG-0005ij-9W for 22657@debbugs.gnu.org; Sun, 14 Feb 2016 14:23:12 -0500 Original-Received: by mail-lb0-f169.google.com with SMTP id ap4so10502610lbd.1 for <22657@debbugs.gnu.org>; Sun, 14 Feb 2016 11:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=BlNXC1M/1IAGnySJ3TkvjRjprh42ZsnvaIvJcmlIPS0=; b=nkgZZBnITB+tm/gbsW6om8NcEy0aIwc40GNiiXvEtCNYpp6t5QUvzi1xJUz/uhBOVX J1kUqIki8ZMWVDmupT9ARDPZg4gP1Z16wMWXvhenClSE9mXPsGkMCrKKmC29qRDimwoT bD9B8+IYVTLKmfrcUWYsdsTwoBldudd9SmDgBtCGJAjvyU5oizCcGppNZjhmId5JwkfW dlZd/BbCIZIgS4TpsyakK0VaBnBCDWQSJD/WRTW/kmwWTwyJcKaIz8YaFglwiolKiFfS M0J8so8m/sVs8D0FO6Y/Z63kSi2BHWVUhyjI5C5eSJS7AISszu9roejvHWCtJhQSV+Kj fwYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=BlNXC1M/1IAGnySJ3TkvjRjprh42ZsnvaIvJcmlIPS0=; b=I+AQCX3HauCChN5EEYvy057jroq1nESmG0Jtdyd1u1ADZTPwwJTK0ZndRFUuBWKmfn hGRJ+anTLRAFsTnVFXKpPpbDxNp6ONEvxFJBUC2U0rBR80M2Pgd7hKR32gSFXFyJLyfP 05gGhcDW5yLEWC53762RBuC5CdwCOIz/7NEThOTM1W6Dx46goqEHUvLpyAc0EuoujkuB HX9di/xG16UxQcWJmlztXNc5T1JSUyRdhfTOG1l/vKZJXjjTnoI1mN/MUcUC9MqpYLHP Fh6v74f1JMKF2DtrQNHOiEM+XNHpYo7drUEM/uwJQE/aBHrF7CNH3w822If7KAuKtLjf 4EqQ== X-Gm-Message-State: AG10YORWoKgN2cJHKN4t5EJqCZHyDGnGpgRQMxExddfNod2CURGDMuYL4+7MENts/uG8eDWFb1K1tHIdq8M6Nw== X-Received: by 10.112.162.168 with SMTP id yb8mr4877789lbb.36.1455477786547; Sun, 14 Feb 2016 11:23:06 -0800 (PST) Original-Received: by 10.25.215.215 with HTTP; Sun, 14 Feb 2016 11:22:47 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113031 Archived-At: --089e0116008e721ac3052bbfd42c Content-Type: text/plain; charset=UTF-8 Nice hint, yeah that helped me find it: index 9ff94aa..63b3fdf 100644 --- a/gdb/python/lib/gdb/printer/bound_registers.py +++ b/gdb/python/lib/gdb/printer/bound_registers.py @@ -25,7 +25,7 @@ class MpxBound128Printer: def to_string (self): upper = self.val["ubound"] lower = self.val["lbound"] - size = (long) ((upper) - (lower)) + size = (int) ((upper) - (lower)) if size > -1: size = size + 1 result = '{lbound = %s, ubound = %s} : size %s' % (lower, upper, size) I'll submit that patch to gdb, that fixed the exception. Thanks, -Doug On Sun, Feb 14, 2016 at 11:20 AM, immerrr again wrote: > On Sun, Feb 14, 2016 at 9:11 PM, Eli Zaretskii wrote: > >> > >> Breakpoint 1, 0x000000000040053a in main () > >> (gdb) Python Exception name 'long' is not defined: > >> Python Exception name 'long' is not defined: > >> Python Exception name 'long' is not defined: > >> Python Exception name 'long' is not defined: > >> > > NameError means something is undefined, so probably gdb is executing > scripts using python3 and some script doesn't account for the fact > that only "long" and "int" types got merged in Python3 world and > "long" no longer exists. > --089e0116008e721ac3052bbfd42c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Nice hint, yeah that helped me find it:
=
index 9ff94aa..63b3fdf 100644
--- a/gdb/python/lib/gdb/printer/bound= _registers.py
+++ b/gdb/python/lib/gdb/printer/bound_registers.py
@@ = -25,7 +25,7 @@ class MpxBound128Printer:
=C2=A0=C2=A0=C2=A0=C2=A0 def to= _string (self):
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 upper = =3D self.val["ubound"]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 lower =3D self.val["lbound"]
-=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 size=C2=A0 =3D (long) ((upper) - (lower))
+=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 size=C2=A0 =3D (int) ((upper) - (lower= ))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if size > -1:
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 si= ze =3D size + 1
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 result = =3D '{lbound =3D %s, ubound =3D %s} : size %s' % (lower, upper, siz= e)

I'll submit that patch to gdb, that fixed the exception= .

Thanks,
-Doug
<= br>
On Sun, Feb 14, 2016 at 11:20 AM, immerrr aga= in <immerrr@gmail.com> wrote:
On Sun, Feb 14, 2016 at 9:11 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>
>> Breakpoint 1, 0x000000000040053a in main ()
>> (gdb) Python Exception <class 'NameError'> name '= ;long' is not defined:
>> Python Exception <class 'NameError'> name 'long&= #39; is not defined:
>> Python Exception <class 'NameError'> name 'long&= #39; is not defined:
>> Python Exception <class 'NameError'> name 'long&= #39; is not defined:
>>

NameError means something is undefined, so probably gdb is executing=
scripts using python3 and some script doesn't account for the fact
that only "long" and "int" types got merged=C2=A0 in Py= thon3 world and
"long" no longer exists.

--089e0116008e721ac3052bbfd42c--