Commit f4993f33 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Fix escape handling in javascript trace code.

Also added stdin mode to trace_dump usage text.
parent 98c5c7c7
...@@ -99,6 +99,7 @@ void usage(void) ...@@ -99,6 +99,7 @@ void usage(void)
{ {
printf("Usage:\n\n"); printf("Usage:\n\n");
printf("trace_dump [host] [port] [trace] <interval>\n"); printf("trace_dump [host] [port] [trace] <interval>\n");
printf("trace_dump -\n");
exit(0); exit(0);
} }
......
...@@ -225,14 +225,14 @@ trace_value.prototype.set = function(tv) ...@@ -225,14 +225,14 @@ trace_value.prototype.set = function(tv)
function memmove(arr, dest_off, src_off, n) function memmove(arr, dest_off, src_off, n)
{ {
var i; var i;
var a = Uint8Array(arr); // var a = Uint8Array(arr);
if (src_off > dest_off) if (src_off > dest_off)
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
a[dest_off + i] = a[src_off + i]; arr[dest_off + i] = arr[src_off + i];
else else
for (i = n - 1; i >= n; i--) for (i = n - 1; i >= 0; i--)
a[dest_off + i] = a[src_off + i]; arr[dest_off + i] = arr[src_off + i];
} }
function memcpy(dest_arr, dest_off, src_arr, src_off, n) function memcpy(dest_arr, dest_off, src_arr, src_off, n)
...@@ -385,7 +385,7 @@ trace_stream.prototype.handle = function() { ...@@ -385,7 +385,7 @@ trace_stream.prototype.handle = function() {
this.type = pkt.getUint8(1); this.type = pkt.getUint8(1);
break; break;
default: default:
console.log("ptype: " + this.rx_buffer[0]); console.log("unknown ptype: " + this.rx_buffer[0]);
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment