aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/kstd/string.py
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-05-02 15:17:21 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-05-02 15:17:21 +0200
commit44961491f7c3097d1182d68f9c34929275d8655c (patch)
tree588e35bafce774dc1016329517dadd3806859644 /scripts/gdb/kstd/string.py
parentff5d5458df2e69c7fca43d78f02ad1c5837a4a22 (diff)
downloadkernel-44961491f7c3097d1182d68f9c34929275d8655c.tar.xz
kernel-44961491f7c3097d1182d68f9c34929275d8655c.zip
debug: optimize string pretty printer
Diffstat (limited to 'scripts/gdb/kstd/string.py')
-rw-r--r--scripts/gdb/kstd/string.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/gdb/kstd/string.py b/scripts/gdb/kstd/string.py
index 6fa9996..8230b21 100644
--- a/scripts/gdb/kstd/string.py
+++ b/scripts/gdb/kstd/string.py
@@ -17,8 +17,9 @@ class KstdStringPrinter:
string_length = storage_size - 1
try:
- string_data = data_pointer.string(encoding="utf-8", length=string_length)
- return f"{string_data}"
+ if hasattr(data_pointer, "lazy_string"):
+ return data_pointer.lazy_string(encoding="utf-8", length=string_length)
+ return data_pointer.string(encoding="utf-8", length=string_length)
except gdb.error:
return "<unreadable memory>"