History

scripts: gdb: vfs: support external dentry names

d_shortname of struct dentry only reserves D_NAME_INLINE_LEN characters and contains garbage for longer names. Use d_name instead, which always references the valid name.

Illia Ostapyshyn committed 1 year ago

Commit e6d3e651 parent 10d04c21 file · +1 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/gdb/linux/vfs.py+1−1
@@ -22,7 +22,7 @@ def dentry_name(d): · 21 unmodified lines
2222 if parent == d or parent == 0:
2323 return ""
2424 p = dentry_name(d['d_parent']) + "/"
25− return p + d['d_shortname']['string'].string()
25+ return p + d['d_name']['name'].string()
2626
2727 class DentryName(gdb.Function):
2828 """Return string of the full path of a dentry.