mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 07:28:38 +08:00
dmesg.py:use 'replace' avoid decode error
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
8b4a4f8539
commit
472b49e11f
1 changed files with 2 additions and 3 deletions
|
@ -43,7 +43,6 @@ class Dmesg(gdb.Command):
|
|||
gdb.write("Ramlog have %d bytes to show\n" % rl_bufsize)
|
||||
|
||||
inf = gdb.selected_inferior()
|
||||
buf = inf.read_memory(rl_head["rl_buffer"], rl_bufsize)
|
||||
clean_data = bytes(buf).replace(b"\x00", "␀".encode("utf-8"))
|
||||
gdb.write(clean_data.decode("utf-8"))
|
||||
buf = bytes(inf.read_memory(rl_head["rl_buffer"], rl_bufsize))
|
||||
gdb.write(buf.decode("utf-8", errors="replace"))
|
||||
gdb.write("\n")
|
||||
|
|
Loading…
Reference in a new issue