def test_d_path(self): task = find_task(self.prog, os.getpid()) self.assertEqual(d_path(task.fs.pwd.address_of_()), os.fsencode(os.getcwd()))
def test_fget(self): with tempfile.NamedTemporaryFile(prefix="drgn-tests-") as f: file = fget(find_task(self.prog, os.getpid()), f.fileno()) self.assertEqual(d_path(file.f_path), os.fsencode(os.path.abspath(f.name)))
def call(self, objs: Iterable[drgn.Object]) -> None: # TODO validate that each input is a struct path or struct path* for obj in objs: print(d_path(obj).decode("utf-8", "backslashreplace"))