public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <kseitz@firetalk.com>
To: duane_ellis@franklin.com
Cc: insight@sourceware.cygnus.com
Subject: Re: Log files & such.
Date: Tue, 23 May 2000 07:07:00 -0000	[thread overview]
Message-ID: <392A9093.4BD7AB7A@firetalk.com> (raw)
In-Reply-To: <200005231344.JAA16276@mercury.franklin.com>

Duane Ellis wrote:
> 
> In INSIGHT, I'm trying to create something like a 'log file' of all
> commands and results sent to the console window.
> 
> Due to the way our target is configured (a compiled in simulator for
> our custom RISC CPU & hardware) - we *MUST* have TCL/TK running at all
> times. We simulate an LCD inside a TCL window, along with buttons and
> so forth, so I cannot use '-nw'.
> 

Very cool!

> Is there a command (or hack) to do this?
>

I don't believe that such a thing exists (but I may be wrong -- it's
been a long time since I looked at the Console Window), but you have
options.

If you do not need everything continuously logged to a file, you could
simply cut and paste the whole console window into a file. Yich. I
suspect this is not what you want...

To do continuous logging, you'll need to hack some stuff into Insight.
First, to grab ALL output to the console window, you'll need to add
something to Console::insert to do this. Simply append the given line to
a file. You could/should add a dialog somewhere (File->Logging...?) to
set this up.

This will grab all output sent to the console window, but it is not
enough... You'll also need to do something similar in Console::invoke so
that commands input via the console window is appended to the log file.
So far so good -- all the changes are in console.itb. Now the tougher
part.

Although you're now capturing all commands entered via the console
window and all output to the console window, you're still missing
anything that happens when the user uses the toolbar or a presses a key
in the source window. I would recommend making a logging class which
takes care of this. There are only a few places where you would have to
add a logging message to show what is happening. For example, I believe
that almost all of the toolbar buttons and keypresses go through gdbtk_*
functions. So for "step", we have a proc called "gdbtk_step"; for
"stepi", "gdbtk_stepi", etc. You could add a call to a static proc in
your logging class with some appropriate message to be appended to the
log file.

All in all, this isn't a difficult thing to do. It shouldn't take longer
than a couple of hours to implement a beta version. Polishing the
configuration dialog will be a much more involving ordeal.

Of course, if you have any questions, you've found the right place to
ask. :-)

Good luck,
Keith
--
Why chat when you can Firetalk?
Firetalk ID: Keith (10320)
www.firetalk.com

      reply	other threads:[~2000-05-23  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-23  6:45 Duane Ellis
2000-05-23  7:07 ` Keith Seitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=392A9093.4BD7AB7A@firetalk.com \
    --to=kseitz@firetalk.com \
    --cc=duane_ellis@franklin.com \
    --cc=insight@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).