GNU bug report logs - #22657
24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer

Previous Next

Package: emacs;

Reported by: douglas.j.anderson <at> gmail.com

Date: Sun, 14 Feb 2016 07:10:02 UTC

Severity: normal

Found in version 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 22657 <at> debbugs.gnu.org (full text, mbox):

From: Douglas Anderson <douglasjanderson <at> gmail.com>
To: immerrr again <immerrr <at> gmail.com>
Cc: 22657 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#22657: 24.5; "Python Exception <class 'NameError'> name
 'long' is not defined" while using gdb registers buffer
Date: Sun, 14 Feb 2016 12:22:47 -0700
[Message part 1 (text/plain, inline)]
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 <immerrr <at> gmail.com> wrote:

> On Sun, Feb 14, 2016 at 9:11 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >>
> >> Breakpoint 1, 0x000000000040053a in main ()
> >> (gdb) Python Exception <class 'NameError'> name 'long' is not defined:
> >> Python Exception <class 'NameError'> name 'long' is not defined:
> >> Python Exception <class 'NameError'> name 'long' is not defined:
> >> Python Exception <class 'NameError'> 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.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.