Skip to content

Commit 6d34d1a

Browse files
committed
Handle missing inode info gracefully
1 parent c856bfd commit 6d34d1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

commands/xinfo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ def get_xinfo(self, process: SBProcess, target: SBTarget, address: int) -> Dict[
114114

115115
if xinfo[XINFO.PATH] is not None and os.path.exists(xinfo[XINFO.PATH]):
116116
xinfo[XINFO.INODE] = os.stat(xinfo[XINFO.PATH]).st_ino
117+
else:
118+
xinfo[XINFO.INODE] = None
117119

118120
return xinfo
119121

@@ -149,7 +151,7 @@ def __call__(
149151
print_message(MSG_TYPE.INFO, f"Pathname: {xinfo[XINFO.PATH]}")
150152
print_message(MSG_TYPE.INFO, f"Offset (from page/region): +{hex(xinfo[XINFO.REGION_OFFSET])}")
151153

152-
if xinfo["inode"] is not None:
154+
if xinfo[XINFO.INODE] is not None:
153155
print_message(MSG_TYPE.INFO, f"Inode: {xinfo[XINFO.INODE]}")
154156
else:
155157
print_message(MSG_TYPE.ERROR, "No inode found: Path cannot be found locally.")

0 commit comments

Comments
 (0)