From 874071ca42d59d0870b2f7055c15d878cbdf1368 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 8 Dec 2016 11:03:25 +0000 Subject: [PATCH] Eo gdb: Add workaround for gdb oddities. These workarounds are required to make sure the plugin works across gdb and python versions. --- data/eo/eo_gdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/eo/eo_gdb.py b/data/eo/eo_gdb.py index e02dd10ebf..2f86fdc0f9 100644 --- a/data/eo/eo_gdb.py +++ b/data/eo/eo_gdb.py @@ -66,7 +66,7 @@ class Eo_resolve(gdb.Function): gdb.Function.__init__(self, 'eo_resolve') def invoke(self, arg): - obj_id = int(arg.cast(zero_uintptr_t.type)) + obj_id = int(str(arg.cast(zero_uintptr_t.type)), 0) mid_table_id = (obj_id >> SHIFT_MID_TABLE_ID) & MASK_MID_TABLE_ID table_id = (obj_id >> SHIFT_TABLE_ID) & MASK_TABLE_ID @@ -124,7 +124,7 @@ class Eo_data_get(gdb.Function): return null_void_ptr # Check if not mixin - if int(kls['desc']['type']) != 3: + if int(kls['desc']['type'].cast(zero_uintptr_t.type)) != 3: return gdb.parse_and_eval('(void *) (((char *) {}) + {})' .format(ptr, kls['data_offset'])) else: