From 4fc7950afa147b420dcb68b18329b41a6ace1d99 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 24 Nov 2018 06:17:09 -0800 Subject: [PATCH] SCP: Prioritize memory buffer writes over debug output --- scp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scp.c b/scp.c index 4bf4f676..7fe0bbe1 100644 --- a/scp.c +++ b/scp.c @@ -12874,12 +12874,10 @@ if (sim_mfile || (f == sim_deb)) { break; } - /* Store the formatted data */ + /* Store the formatted data with priority to a + memory file vs debug de-duplication*/ - if (f == sim_deb) { - _sim_debug_write (buf, len); - } - else { + if (sim_mfile) { if (sim_mfile->pos + len > sim_mfile->size) { sim_mfile->size = sim_mfile->pos + 2 * MAX(bufsize, 512); sim_mfile->buf = (char *)realloc (sim_mfile->buf, sim_mfile->size); @@ -12887,6 +12885,9 @@ if (sim_mfile || (f == sim_deb)) { memcpy (sim_mfile->buf + sim_mfile->pos, buf, len); sim_mfile->pos += len; } + else { + _sim_debug_write (buf, len); + } if (buf != stackbuf) free (buf);