'read_var with respect to code blocks (gdbframe.read_var works with
respect to the most recent block)
Apparently this function doesn\'t work, though, as it seems to read
variables in other frames also sometimes.'

def read_var(self, varname):

    block = self._gdbframe.block()
    var = None
    while (block and (var is None)):
        try:
            var = self._gdbframe.read_var(varname, block)
        except ValueError:
            pass
        block = block.superblock
    return var
