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++)
|
for (i = 0; i < cap; i++)
|
||||||
{
|
{
|
||||||
if (i == offs) result.append("\033[34m[\033[0m");
|
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)
|
if (i < offs || i >= offs+len)
|
||||||
result.print(
|
result.print(
|
||||||
|
@ -61,6 +61,7 @@ proc startioc {} {
|
|||||||
puts $fd "dbLoadDatabase ../O.Common/streamApp.dbd"
|
puts $fd "dbLoadDatabase ../O.Common/streamApp.dbd"
|
||||||
puts $fd "streamApp_registerRecordDeviceDriver"
|
puts $fd "streamApp_registerRecordDeviceDriver"
|
||||||
}
|
}
|
||||||
|
puts $fd "streamSetLogfile StreamDebug.log"
|
||||||
puts $fd "epicsEnvSet STREAM_PROTOCOL_PATH ."
|
puts $fd "epicsEnvSet STREAM_PROTOCOL_PATH ."
|
||||||
puts $fd "drvAsynIPPortConfigure device localhost:$port"
|
puts $fd "drvAsynIPPortConfigure device localhost:$port"
|
||||||
puts $fd "dbLoadRecords test.db"
|
puts $fd "dbLoadRecords test.db"
|
||||||
@ -172,7 +173,7 @@ proc escape {string} {
|
|||||||
append result "\\r"
|
append result "\\r"
|
||||||
} elseif {$n == 10} {
|
} elseif {$n == 10} {
|
||||||
append result "\\n"
|
append result "\\n"
|
||||||
} elseif {($n & 127) < 32} {
|
} elseif {$n < 32 || $n >= 127} {
|
||||||
append result [format "<%02x>" $n]
|
append result [format "<%02x>" $n]
|
||||||
} else {
|
} else {
|
||||||
append result $c
|
append result $c
|
||||||
|
Reference in New Issue
Block a user