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]

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


gdb/Changelog:

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

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 745ab7b..7bf79e1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-20  Jonah Graham  <jonah@kichwacoders.com>
+
+	* python/lib/gdb/printer/bound_registers.py: Add support
+	for Python 3.
+
 2016-11-26  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* ui-out.h (struct ui_out_impl): Remove comment.
diff --git a/gdb/python/lib/gdb/printer/bound_registers.py b/gdb/python/lib/gdb/printer/bound_registers.py
index 9ff94aa..50509fb 100644
--- a/gdb/python/lib/gdb/printer/bound_registers.py
+++ b/gdb/python/lib/gdb/printer/bound_registers.py
@@ -14,8 +14,15 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import sys
+
 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.10.2


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