summaryrefslogtreecommitdiff
path: root/lib/ccdbg-debug.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-12-30 22:35:53 -0800
committerKeith Packard <keithp@keithp.com>2008-12-30 22:38:35 -0800
commit6c2a65c743a4ffae96ed27dbc38c1bf9242ed1df (patch)
treebea5fb122dfcc2edfcff0baca30dd1166a1d24af /lib/ccdbg-debug.c
parentea366058aa467a8a7caf17e7014758f3741ea7f7 (diff)
Save/restore registers to host during memory operations. Cache ROM data.
Because the debug port uses instructions for most operations, the debug code will clobber registers used by the running program. Save and restore these to avoid corrupting application data. If the ROM file is known, use that to return data instead of fetching it from the target to improve performance. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'lib/ccdbg-debug.c')
-rw-r--r--lib/ccdbg-debug.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ccdbg-debug.c b/lib/ccdbg-debug.c
index 8f6f9e11..847361c7 100644
--- a/lib/ccdbg-debug.c
+++ b/lib/ccdbg-debug.c
@@ -47,7 +47,8 @@ ccdbg_debug(int level, char *format, ...)
}
void
-ccdbg_flush(void)
+ccdbg_flush(int level)
{
- fflush(stdout);
+ if (ccdbg_level & level)
+ fflush(stdout);
}