This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] bound_registers.py: Add support for Python 3
- From: Jonah Graham <jonah at kichwacoders dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jonah Graham <jonah at kichwacoders dot com>
- Date: Sat, 26 Nov 2016 18:54:35 +0000
- Subject: [PATCH] bound_registers.py: Add support for Python 3
- Authentication-results: sourceware.org; auth=none
- References: <CAPmGMvgXuTqhWxXLihM1S_TF3gXF79cA=KrSDD46aqF_USNbDA@mail.gmail.com>
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