mirror of
https://github.com/apache/nuttx.git
synced 2026-08-31 06:03:12 +00:00
gdb/dmesg: replace non-printable NULL terminator
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
472b49e11f
commit
4e6026efe6
1 changed files with 3 additions and 0 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue