Fix gdb communication error (#82)
[riscv-isa-sim.git] / riscv / gdbserver.cc
index 3e68872b3cbcb52310921d431f3deced74eccea8..4303adfed38a6cbecbf8cce251a2f397331e4f80 100644 (file)
@@ -325,7 +325,7 @@ void circular_buffer_t<T>::append(const T *src, unsigned int count)
   count -= copy;
   if (count > 0) {
     assert(count < contiguous_empty_size());
-    memcpy(contiguous_empty(), src, count * sizeof(T));
+    memcpy(contiguous_empty(), src+copy, count * sizeof(T));
     data_added(count);
   }
 }