This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] bound_registers.py: Add support for Python 3


On 03/08/2017 08:34 AM, Jonah Graham wrote:
> On 26 November 2016 at 21:26, Luis Machado <lgustavo@codesourcery.com> wrote:
>> On 11/26/2016 10:27 AM, Jonah Graham wrote:

>>> Is there more I am supposed to do to get this patch into GDB? If so,
>>> please advise and I would be happy to.
>>
>>
>> One of the maintainers needs to OK it, which shouldn't that that long. Given
>> the size of the patch, i don't there's anything else that should be done
>> code-wise.
>>
> 
> Ping on this patch. Please let me know if there is anything else I can
> do to get it in.
> 

Thanks for the patch.

I've pushed it in, as below.  (I added the reference to printing.py to the
commit log, and the PR number, so that the commit is logged in bugzilla
automatically.)

>From 7503099f3e29739d34cb1224d54fba96404e6e61 Mon Sep 17 00:00:00 2001
From: Jonah Graham <jonah@kichwacoders.com>
Date: Fri, 17 Mar 2017 14:57:44 +0000
Subject: [PATCH] Fix PR gdb/19637: bound_registers.py: Add support for Python
 3

Fix this the same way gdb/python/lib/gdb/printing.py handles it.

gdb/Changelog:
2017-03-17  Jonah Graham  <jonah@kichwacoders.com>

	PR gdb/19637
	* python/lib/gdb/printer/bound_registers.py: Add support for
	Python 3.
---
 gdb/ChangeLog                                 | 6 ++++++
 gdb/python/lib/gdb/printer/bound_registers.py | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d0d0f72..6d81cf5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2017-03-17  Jonah Graham  <jonah@kichwacoders.com>
+
+	PR gdb/19637
+	* python/lib/gdb/printer/bound_registers.py: Add support for
+	Python 3.
+
 2017-03-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
 	* dwarf2loc.c (indirect_synthetic_pointer): Get data type of
diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py
index b315690..104ea7f 100644
--- a/gdb/python/lib/gdb/printer/bound_registers.py
+++ b/gdb/python/lib/gdb/printer/bound_registers.py
@@ -16,6 +16,11 @@
 
 import gdb.printing
 
+if sys.version_info[0] > 2:
+    # Python 3 removed basestring and long
+    basestring = str
+    long = int
+
 class MpxBound128Printer:
     """Adds size field to a mpx __gdb_builtin_type_bound128 type."""
 
-- 
2.5.5



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]