From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: duane_ellis@franklin.com Cc: insight@sourceware.cygnus.com Subject: Re: Log files & such. Date: Tue, 23 May 2000 07:07:00 -0000 Message-id: <392A9093.4BD7AB7A@firetalk.com> References: <200005231344.JAA16276@mercury.franklin.com> X-SW-Source: 2000-q2/msg00204.html 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