aboutsummaryrefslogtreecommitdiffstats
path: root/src/output.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-10-24 19:56:11 -0400
commitc604f2f6be0ad729c8e25958c946a8535ca391ee (patch)
tree561c46af38c11dbc55685f525202b7a9d0c12e09 /src/output.c
parenta5826b5ad482f44d293387dc7513e5e98802a54e (diff)
downloadseabios-c604f2f6be0ad729c8e25958c946a8535ca391ee.tar.gz
Improve debugging output from threads.
Show the "thread id" on each debug message sent from a thread. Also, cleanup translation dprintf() so it looks nicer withe thread output.
Diffstat (limited to 'src/output.c')
-rw-r--r--src/output.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/output.c b/src/output.c
index e860b0b2..7f74a69e 100644
--- a/src/output.c
+++ b/src/output.c
@@ -115,7 +115,7 @@ static void
putc_screen(struct putcinfo *action, char c)
{
if (CONFIG_SCREEN_AND_DEBUG)
- putc_debug(action, c);
+ putc_debug(&debuginfo, c);
if (c == '\n')
screenc('\r');
screenc(c);
@@ -325,6 +325,18 @@ panic(const char *fmt, ...)
void
__dprintf(const char *fmt, ...)
{
+ if (!MODE16 && CONFIG_THREADS && CONFIG_DEBUG_LEVEL >= DEBUG_thread
+ && *fmt != '\\' && *fmt != '/') {
+ struct thread_info *cur = getCurThread();
+ if (cur != &MainThread) {
+ // Show "thread id" for this debug message.
+ putc_debug(&debuginfo, '|');
+ puthex(&debuginfo, (u32)cur, 8);
+ putc_debug(&debuginfo, '|');
+ putc_debug(&debuginfo, ' ');
+ }
+ }
+
va_list args;
va_start(args, fmt);
bvprintf(&debuginfo, fmt, args);