unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
@ 2016-02-14  5:00 Douglas Anderson
  2016-02-14 16:34 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Douglas Anderson @ 2016-02-14  5:00 UTC (permalink / raw)
  To: 22657

[-- Attachment #1: Type: text/plain, Size: 4714 bytes --]

Hello,

I'm using current stable on Ubuntu 15.10.

Steps to reproduce:
 - open emacs gdb-many-windows mode (I only hit this bug if the registers
buffer is open)
 - set a breakpoint
 - run

The following text appears in the gud window:
(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:

Hitting enter reruns the program from the beginning.

-Doug
----
In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-17 on lgw01-52, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11702000
System Description:    Ubuntu 15.10

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Debugger

Minor modes in effect:
  gdb-many-windows: t
  shell-dirtrack-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  show-paren-mode: t
  electric-layout-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Making completion list...
Quit
Making completion list...
Complete, but not unique
Making completion list...
Complete, but not unique
~/dev/hw/cu/computer_systems/2_bomblab/bomb122
Target doesn't support non-stop mode.  Turning it off.
Gdb-Many-Windows mode enabled
Switched to thread 1
completing-read-default: Command attempted to use minibuffer while in
minibuffer

Load-path shadows:
/usr/share/emacs/24.5/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils thingatpt pcase vc-git ggtags etags
compile ewoc disp-table cc-langs cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs pcmpl-unix gdb-mi
bindat json gud easy-mmode init shell pcomplete comint ansi-color ring
delsel fill-column-indicator flycheck find-func help-mode rx subr-x seq
dash server exec-path-from-shell wombat-theme elec-pair cus-start
cus-load paren edmacro kmacro cl-loaddefs cl-lib saveplace ido info
easymenu package epg-config time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 217848 73052)
 (symbols 48 29676 1)
 (miscs 40 285 586)
 (strings 32 56149 52692)
 (string-bytes 1 1626801)
 (vectors 16 28647)
 (vector-slots 8 1284058 121485)
 (floats 8 117 570)
 (intervals 56 830 86)
 (buffers 960 26)
 (heap 1024 71315 3522))

[-- Attachment #2: Type: text/html, Size: 5300 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14  5:00 bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer Douglas Anderson
@ 2016-02-14 16:34 ` Eli Zaretskii
  2016-02-14 17:22   ` Douglas Anderson
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-14 16:34 UTC (permalink / raw)
  To: douglas.j.anderson; +Cc: 22657

> From: Douglas Anderson <douglasjanderson@gmail.com>
> Date: Sat, 13 Feb 2016 22:00:49 -0700
> 
> I'm using current stable on Ubuntu 15.10.
> 
> Steps to reproduce:
> - open emacs gdb-many-windows mode (I only hit this bug if the registers
> buffer is open)
> - set a breakpoint
> - run
> 
> The following text appears in the gud window:
> (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: 
> 
> Hitting enter reruns the program from the beginning.

I cannot reproduce this.  Please show the exact sequence of commands
you used, including the program which you ran under the debugger, for
me to be sure I did the same.

Also, what is your GDB version?

IME, Python exceptions in GDB usually mean your Python support files
are from a different GDB version, so perhaps double-check your GDB
installation.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14 16:34 ` Eli Zaretskii
@ 2016-02-14 17:22   ` Douglas Anderson
  2016-02-14 18:11     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Douglas Anderson @ 2016-02-14 17:22 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 22657

[-- Attachment #1: Type: text/plain, Size: 2962 bytes --]

Thanks Eli,

I did `$ sudo apt-get purge emacs && sudo apt-get update && sudo apt-get
install emacs` to make sure my installation wasn't corrupted.

I don't have any gdb-specific lines in my init.el

$ gdb --version
GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
[...]

$ cat test.c
#include <stdio.h>
int main() {printf("Testing...\n");}

$ gcc --version
gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

$ gcc test.c

M-x gdb
Run gdb (like this): gdb -i=mi a.out
(If it opens in many-windows mode, continue on, if not, do M-x
gdb-display-registers-buffer)

(gdb) b main
Breakpoint 1 at 0x40053a
(gdb) r
Starting program:[...]/a.out

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:

(I hit Enter a few times)

Starting program: [...]/a.out

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:


Breakpoint 1, 0x000000000040053a in main ()
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:

In the status line, it says, "error in process filter: Bad string format:
"doesn't start with '\"\!"

If you still can't reproduce, maybe it's a bug for the ubuntu package
maintainer.
Thanks,
-Doug

On Sun, Feb 14, 2016 at 9:34 AM, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Douglas Anderson <douglasjanderson@gmail.com>
> > Date: Sat, 13 Feb 2016 22:00:49 -0700
> >
> > I'm using current stable on Ubuntu 15.10.
> >
> > Steps to reproduce:
> > - open emacs gdb-many-windows mode (I only hit this bug if the registers
> > buffer is open)
> > - set a breakpoint
> > - run
> >
> > The following text appears in the gud window:
> > (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:
> >
> > Hitting enter reruns the program from the beginning.
>
> I cannot reproduce this.  Please show the exact sequence of commands
> you used, including the program which you ran under the debugger, for
> me to be sure I did the same.
>
> Also, what is your GDB version?
>
> IME, Python exceptions in GDB usually mean your Python support files
> are from a different GDB version, so perhaps double-check your GDB
> installation.
>
> Thanks.
>

[-- Attachment #2: Type: text/html, Size: 4199 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14 17:22   ` Douglas Anderson
@ 2016-02-14 18:11     ` Eli Zaretskii
  2016-02-14 18:20       ` immerrr again
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-14 18:11 UTC (permalink / raw)
  To: douglas.j.anderson; +Cc: 22657

> From: Douglas Anderson <douglasjanderson@gmail.com>
> Date: Sun, 14 Feb 2016 10:22:40 -0700
> Cc: 22657@debbugs.gnu.org
> 
> I did `$ sudo apt-get purge emacs && sudo apt-get update && sudo apt-get install emacs` to make sure my
> installation wasn't corrupted.

I suggest to do the same for your GDB installation.  The exceptions
come from the GDB Python support files, so maybe they are
misconfigured.

> $ gdb --version
> GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10

I also use GDB 7.10.

> $ gcc --version
> gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010

My GCC is 4.8.1, not sure if this is related.

> $ gcc test.c
> 
> M-x gdb
> Run gdb (like this): gdb -i=mi a.out
> (If it opens in many-windows mode, continue on, if not, do M-x gdb-display-registers-buffer)
> 
> (gdb) b main
> Breakpoint 1 at 0x40053a
> (gdb) r
> Starting program:[...]/a.out 
> 
> 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: 
> 
> (I hit Enter a few times)
> 
> Starting program: [...]/a.out 
> 
> 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: 
> 
> Breakpoint 1, 0x000000000040053a in main ()
> 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: 
> 
> In the status line, it says, "error in process filter: Bad string format: "doesn't start with '\"\!"
> 
> If you still can't reproduce, maybe it's a bug for the ubuntu package maintainer. 

I still cannot reproduce this.  If updating GDB (perhaps to the latest
version 7.10.1) doesn't help, please take it up with the Ubuntu
package maintainers.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14 18:11     ` Eli Zaretskii
@ 2016-02-14 18:20       ` immerrr again
  2016-02-14 19:22         ` Douglas Anderson
  0 siblings, 1 reply; 7+ messages in thread
From: immerrr again @ 2016-02-14 18:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: douglas.j.anderson, 22657

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' 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14 18:20       ` immerrr again
@ 2016-02-14 19:22         ` Douglas Anderson
  2016-02-14 19:28           ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Douglas Anderson @ 2016-02-14 19:22 UTC (permalink / raw)
  To: immerrr again; +Cc: 22657

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

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@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' 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.
>

[-- Attachment #2: Type: text/html, Size: 2089 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer
  2016-02-14 19:22         ` Douglas Anderson
@ 2016-02-14 19:28           ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-14 19:28 UTC (permalink / raw)
  To: douglas.j.anderson; +Cc: 22657-done, immerrr

> From: Douglas Anderson <douglasjanderson@gmail.com>
> Date: Sun, 14 Feb 2016 12:22:47 -0700
> Cc: Eli Zaretskii <eliz@gnu.org>, 22657@debbugs.gnu.org
> 
> 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, closing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-14 19:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-14  5:00 bug#22657: 24.5; "Python Exception <class 'NameError'> name 'long' is not defined" while using gdb registers buffer Douglas Anderson
2016-02-14 16:34 ` Eli Zaretskii
2016-02-14 17:22   ` Douglas Anderson
2016-02-14 18:11     ` Eli Zaretskii
2016-02-14 18:20       ` immerrr again
2016-02-14 19:22         ` Douglas Anderson
2016-02-14 19:28           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).