escape all chars higher than 127 in debug output to <..> to avoid problems with unicode terminals
This commit is contained in:
@ -317,7 +317,7 @@ dump() const
|
||||
for (i = 0; i < cap; i++)
|
||||
{
|
||||
if (i == offs) result.append("\033[34m[\033[0m");
|
||||
if ((buffer[i] & 0x7f) < 0x20 || (buffer[i] & 0x7f) == 0x7f)
|
||||
if (buffer[i] < 0x20 || buffer[i] >= 0x7f)
|
||||
{
|
||||
if (i < offs || i >= offs+len)
|
||||
result.print(
|
||||
|
@ -61,6 +61,7 @@ proc startioc {} {
|
||||
puts $fd "dbLoadDatabase ../O.Common/streamApp.dbd"
|
||||
puts $fd "streamApp_registerRecordDeviceDriver"
|
||||
}
|
||||
puts $fd "streamSetLogfile StreamDebug.log"
|
||||
puts $fd "epicsEnvSet STREAM_PROTOCOL_PATH ."
|
||||
puts $fd "drvAsynIPPortConfigure device localhost:$port"
|
||||
puts $fd "dbLoadRecords test.db"
|
||||
@ -172,7 +173,7 @@ proc escape {string} {
|
||||
append result "\\r"
|
||||
} elseif {$n == 10} {
|
||||
append result "\\n"
|
||||
} elseif {($n & 127) < 32} {
|
||||
} elseif {$n < 32 || $n >= 127} {
|
||||
append result [format "<%02x>" $n]
|
||||
} else {
|
||||
append result $c
|
||||
|
Reference in New Issue
Block a user