mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
gdb/dmesg: replace non-printable NULL terminator
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -44,5 +44,8 @@ class Dmesg(gdb.Command):
|
||||
|
||||
inf = gdb.selected_inferior()
|
||||
buf = bytes(inf.read_memory(rl_head["rl_buffer"], rl_bufsize))
|
||||
buf = buf.replace(
|
||||
b"\0", "␀".encode("utf-8")
|
||||
) # NULL is valid utf-8 but not printable
|
||||
gdb.write(buf.decode("utf-8", errors="replace"))
|
||||
gdb.write("\n")
|
||||
|
||||
Reference in New Issue
Block a user