Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb: upgrade to be python 3 compatible #6698

Closed
LukeMauldin opened this issue Oct 31, 2013 · 12 comments
Closed

gdb: upgrade to be python 3 compatible #6698

LukeMauldin opened this issue Oct 31, 2013 · 12 comments

Comments

@LukeMauldin
Copy link

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Build a Golang program and launch is with GDB.  Using Ubuntu 13.10, GDB 7.6.1. 
Golang version 1.2rc2.  Note, I have go installed in /opt/go and I have a symbolic link
linking /usr/local/go to /opt/go

What is the expected output?
Debugging to work correctly

What do you see instead?
luke@luke-laptop:~/projects/goexternal/src/tf/meetingmessage$ gdb ./meetingmessage 
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>;...
Reading symbols from
/home/luke/projects/goexternal/src/tf/meetingmessage/meetingmessage...done.
  File "/opt/go/src/pkg/runtime/runtime-gdb.py", line 358
    print s, ptr['goid'], "%8s" % sts[long((ptr['status']))], blk.function
          ^
SyntaxError: invalid syntax
(gdb)
@robpike
Copy link
Contributor

robpike commented Oct 31, 2013

Comment 1:

Looks like Python 3 looking at Python 2 code. Does gdb 7.6.1 and/or your system require
Python 3?

Status changed to WaitingForReply.

@gopherbot
Copy link

Comment 2 by scaganoff:

I get this same error after upgrading Ubuntu 13.04 to 13.10.
My default python is:
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)

@minux
Copy link
Member

minux commented Nov 7, 2013

Comment 3:

Ubuntu 13.10's gdb is using python 3 (as verified by ldd: it links to
libpython3.3m.so.1.0).
For the time being, I suggest you install (or build) a gdb with python2 binding.

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 4:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 6:

Labels changed: added repo-main.

@gopherbot
Copy link

Comment 7 by robertknight:

Here is an initial patch which updates runtime-gdb.py to be Python 2.6.x+ / Python 3.x
compatible: https://gist.github.com/robertknight/7973000
I've done very basic testing with it - inspecting goroutines etc.

Attachments:

  1. runtime-gdb.py.diff (3321 bytes)

@gopherbot
Copy link

Comment 8 by gigovich:

my version of fix https://golang.org/cl/43780045

@gopherbot
Copy link

Comment 9:

Good workaround from
https://groups.google.com/forum/#!msg/golang-nuts/VcmSvq2mSm0/LfTp3CUhel8J :
2to3 -w PATH_TO_GO/src/pkg/runtime/runtime-gdb.py

@robpike
Copy link
Contributor

robpike commented Mar 5, 2014

Comment 10:

Labels changed: added gdb.

@minux
Copy link
Member

minux commented Mar 5, 2014

Comment 11:

Has this issue been fully addressed by https://golang.org/cl/53590043?

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@mwhudson
Copy link
Contributor

To answer minux's question from two years ago, yes, this seems to be fixed.

@golang golang locked and limited conversation to collaborators Mar 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants