public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Log files & such.
@ 2000-05-23  6:45 Duane Ellis
  2000-05-23  7:07 ` Keith Seitz
  0 siblings, 1 reply; 2+ messages in thread
From: Duane Ellis @ 2000-05-23  6:45 UTC (permalink / raw)
  To: insight

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'.

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

Or can somebody point me to the right place in the 
tcl/tk/itcl/itk/tui/alphabet-soup  to go look?

-Duane.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Log files & such.
  2000-05-23  6:45 Log files & such Duane Ellis
@ 2000-05-23  7:07 ` Keith Seitz
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2000-05-23  7:07 UTC (permalink / raw)
  To: duane_ellis; +Cc: insight

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-23  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-23  6:45 Log files & such Duane Ellis
2000-05-23  7:07 ` Keith Seitz

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).