def string(infofunc, data=None): weenix.assert_type("&" + infofunc, _dbg_infofunc_type) if data == None: data = "0" npages = 8 buf = weenix.eval_func("page_alloc_n", npages) weenix.eval_func(infofunc, data, buf, "PAGE_SIZE") res = buf.cast(_char_p_type).string() weenix.eval_func("page_free_n", buf, npages) return res
def string(infofunc, data=None): weenix.assert_type("&" + infofunc, _dbg_infofunc_type) if (data == None): data = "0" npages = 8 buf = weenix.eval_func("page_alloc_n", npages) weenix.eval_func(infofunc, data, buf, "PAGE_SIZE") res = buf.cast(_char_p_type).string() weenix.eval_func("page_free_n", buf, npages) return res
def invoke(self, arg, tty): if len(arg.strip()) == 0: info = weenix.info.string("dbg_modes_info") if len(info) == 0: gdb.write("No active modes.\n") else: gdb.write("{0}\n".format(weenix.info.string("dbg_modes_info"))) else: modes = self._modes() for mode in arg.split(): name = mode[1:] if (mode.startswith("-")) else mode if not name in modes: gdb.write('warning: skipping non-existant mode "{0}"\n'.format(name)) else: weenix.eval_func("dbg_add_mode", '"{0}"'.format(mode))
def invoke(self, arg, tty): if (len(arg.strip()) == 0): info = weenix.info.string("dbg_modes_info") if (len(info) == 0): gdb.write("No active modes.\n") else: gdb.write("{0}\n".format(weenix.info.string("dbg_modes_info"))) else: modes = self._modes() for mode in arg.split(): name = mode[1:] if (mode.startswith("-")) else mode if (not name in modes): gdb.write( "warning: skipping non-existant mode \"{0}\"\n".format( name)) else: weenix.eval_func("dbg_add_mode", "\"{0}\"".format(mode))
def lookup(pid): return Proc(weenix.eval_func("proc_lookup", pid).dereference())