From efc00a787140c52eca04e519c95a6862bd5ff1f2 Mon Sep 17 00:00:00 2001 From: pompolic <pompolic@special-circumstanc.es> Date: Wed, 18 May 2022 21:40:08 +0200 Subject: [PATCH] (WIP) Add warning about passing strings to gdb.Value() --- gdb-port/ast.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb-port/ast.py b/gdb-port/ast.py index e8a8d65..99e1f83 100644 --- a/gdb-port/ast.py +++ b/gdb-port/ast.py @@ -82,6 +82,10 @@ class HParsedToken: def __init__(self, address, parent, token_type=None, children=[]): + # Intended to warn about the difference between "0xdeadbeef" and 0xdeadbeef + # The former will allocate an char[] and cast it to a HParsedToken* when reading members + if isinstance(address, str): + print("Warning: Address % given to HParsedToken is a string. This is probably an error (expecting int or gdb.Value" % address) self.address = address self.parent = parent self.children = children -- GitLab