Your message dated Mon, 07 Jul 2014 08:03:22 +0200
with message-id <[email protected]>
and subject line Re: Bug#752662: make the -gdb.py file compatible with python3
has caused the Debian Bug report #752662,
regarding make the -gdb.py file compatible with python3
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
752662: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752662
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: src:golang
Version: 2:1.1.1-4
Tags: patch

please make the -gdb.py file compatible with python3. this version is supposed
to work with both python2 and python3.

--- runtime-gdb.py.orig 2014-06-25 13:54:12.000000000 +0200
+++ runtime-gdb.py      2014-06-25 13:55:07.000000000 +0200
@@ -16,8 +16,10 @@
 
 
 import sys, re
+if sys.version > '3':
+       long = int
 
-print >>sys.stderr, "Loading Go Runtime support."
+print("Loading Go Runtime support.", file=sys.stderr)
 
 # allow to manually reload while developing
 goobjfile = gdb.current_objfile() or gdb.objfiles()[0]
@@ -90,7 +92,7 @@
                flags = self.val['flags']
                inttype = self.val['hash0'].type
                cnt = 0
-               for bucket in xrange(2 ** B):
+               for bucket in range(2 ** B):
                        bp = buckets + bucket
                        if oldbuckets:
                                oldbucket = bucket & (2 ** (B - 1) - 1)
@@ -101,7 +103,7 @@
                                        bp = oldbp
                        while bp:
                                b = bp.dereference()
-                               for i in xrange(8):
+                               for i in range(8):
                                        if b['tophash'][i] != 0:
                                                k = b['keys'][i]
                                                v = b['values'][i]
@@ -154,7 +156,7 @@
                        pass
        return matcher
 
-goobjfile.pretty_printers.extend([makematcher(k) for k in vars().values() if 
hasattr(k, 'pattern')])
+goobjfile.pretty_printers.extend([makematcher(k) for k in 
list(vars().values()) if hasattr(k, 'pattern')])
 
 #
 #  For reference, this is what we're trying to do:
@@ -355,7 +357,7 @@
                        pc = ptr['sched']['pc'].cast(vp)
                        sp = ptr['sched']['sp'].cast(vp)
                        blk = gdb.block_for_pc(long((pc)))
-                       print s, ptr['goid'], "%8s" % 
sts[long((ptr['status']))], blk.function
+                       print(s, ptr['goid'], "%8s" % 
sts[long((ptr['status']))], blk.function)
 
 def find_goroutine(goid):
        vp = gdb.lookup_type('void').pointer()
@@ -363,7 +365,7 @@
                if ptr['status'] == 6:  # 'gdead'
                        continue
                if ptr['goid'] == goid:
-                       return [ptr['sched'][x].cast(vp) for x in 'pc', 'sp']
+                       return [ptr['sched'][x].cast(vp) for x in ('pc', 'sp')]
        return None, None
 
 
@@ -387,7 +389,7 @@
                goid = gdb.parse_and_eval(goid)
                pc, sp = find_goroutine(int(goid))
                if not pc:
-                       print "No such goroutine: ", goid
+                       print("No such goroutine: ", goid)
                        return
                save_frame = gdb.selected_frame()
                gdb.parse_and_eval('$save_pc = $pc')
@@ -413,8 +415,8 @@
                        try:
                                #TODO fix quoting for qualified variable names
                                obj = gdb.parse_and_eval("%s" % obj)
-                       except Exception, e:
-                               print "Can't parse ", obj, ": ", e
+                       except Exception as e:
+                               print("Can't parse ", obj, ": ", e)
                                continue
 
                        if obj['data'] == 0:
@@ -423,10 +425,10 @@
                                dtype = iface_dtype(obj)
                                
                        if dtype is None:
-                               print "Not an interface: ", obj.type
+                               print("Not an interface: ", obj.type)
                                continue
 
-                       print "%s: %s" % (obj.type, dtype)
+                       print("%s: %s" % (obj.type, dtype))
 
 # TODO: print interface's methods and dynamic type's func pointers thereof.
 #rsc: "to find the number of entries in the itab's Fn field look at 
itab.inter->numMethods

--- End Message ---
--- Begin Message ---
control: fixed -1 2:1.3-1

Hi Matthias,

Matthias Klose <[email protected]> writes:
> please make the -gdb.py file compatible with python3. this version is supposed
> to work with both python2 and python3.
I think this is fixed in 2:1.3-1 due to upstream changes.

In case any issue still remains, can you please submit patches for that
directly to upstream (and then file an issue to get the upstream fix
backported)?

Thanks.

-- 
Best regards,
Michael

--- End Message ---

Reply via email to