Version 83 of RamDebugger

Updated 2009-02-03 15:44:22 by LV

RamDebugger is a graphical debugger for the scripting language Tcl-Tk.

  Current version: 6.2

Changes in version: [L1 ]

http://www.gidhome.com/RamDebugger/Ramdebugger_images/image0.gif

With RamDebugger, it is possible to make Local Debugging, where the debugger starts the program to be debugged. and Remote debugging, where the program to debug is already started and RamDebugger connects to it.

RamDebugger has additional capabilities like:

  • Editing the code. It is possible to edit the code inside its own editor and resend the new code without closing the debugged program.
  • The TCL-TK source code is colorized and supports automatic indentation.
  • When stopping the debugger is one source code line, it is possible to view all the variables and expression values, as well as change them.
  • It has additional options to measure execution times in the debugged program.
  • Works in Linux and Windows
  • Includes additional packages, like Tkcon and VisualRegexp, developed by third party people, as a convenience for RamDebugger users.
  • The same program is an IDE for compiling and debugging c and c++

Ramdebugger web page: [L2 ]


Larry Smith 9/25/2007 link brings up error page. pcam download link ftp://ftp.compassis.com/pub/ramdebugger [L3 ] UKo 2007-10-05: unfortunately the starkit presented there is only for windows ... ramsan 2007-10-06 It should work now. UKo 2007-10-07: No :-( Some of the binary packages from 6.1.2.kit have only dll (resizer, Img, tktablet, treectrl, vfs, tkhtml2, RamDebuggerInstrumenter6).

MHo 2007-10-17: Can't download, tried every possible way. Downloads only have size of 1k or so.

JSI 2007-10-18: Had no problem using FF1.5WIN32. Does the 1k-file perhaps contain an error message? My connect did need its time to show the dirlist, but then everything went on fine:

 File: RamDebugger6.1.2.kit 5588 KB 04.10.2007 12:24:00
 File: RamDebugger6.1.2.zip 5006 KB 04.10.2007 12:27:00

LV 2009-Feb-03 I was able to access the Ramdebugger web page without an error message. However, it did take a while to come up.

Copyright Ramon Ribo (RAMSAN). Webpage: [L4 ]


Contains some of the worst user interface design I've ever seen. Select About under the Help menu. Some people might think that this is cute, but it annoys me to the nth degree. Seeing this only makes me doubt the quality of the rest of this application.

ramsan says: What is the thing that you didn't like? If it is the button issue, consider it just as a joke. Do not forget that it is an About window, not so necessary to work with the program. If you have other comments about the UI design out of the About Window, I'll appreciate any comment.

14/Jun/2003 Joe Mistachkin says: To the ANONYMOUS person above who criticized this app, first of all, if you want to be taken seriously, you should post with your name. Second, I think the about box is rather innovative. Finally, if you don't like it, modify it yourself and stop whining.


AJD First impressions are that this is an excellent, easy-to-use debugger. Thank you Ramon for making this public - it is obvious that large amount of effort has gone into this. One improvement I'd suggest is that in the variable list, it would be nice if array variables could be shown with the key/values on separate lines - similar to how structs are shown in Visual Studio.


VL 11 jun 2003: Perhaps add a note here about the ongoing discussion of using it with m68k-palmos-gdb on c.l.tcl? I would personally be very interested in that usage as well, I am on w2k so I will be able to help with some testing once you have the basic stuff dealt with.

Try to change the name gdb into another name in these two locations:

  if { [auto_execok gdb] == "" } {   (near line 471)
    ...
    error "Could not find command 'gdb'"
  }

  set fid [open "|gdb -q |& cat" r+]  (near line 504)

Debugger appears not to instrument code within a switch statement, so it can't be stepped through.

ramsan answers:

It can instrument switch in this way:

    switch ?options? string {pattern body ?pattern body ...?}

and not in this way:

    switch ?options? string pattern body ?pattern body ...?

This has always worked:

 switch aa {
    aa {
        set aa 3
    }
 }

this is not instrumented, but does not give any error:

    switch aa aa {
        set aa 3
    }

If I include a command-line argument with a . in it in the "tcl execution arguments" window, debugger complains that it's not a tk application and my argument is a bad window name.

ramsan answers: It works for me. Are you sure that this is a RamDebugger problem?

The debug start command is on one menu; the stop command is on another menu and buried two deep.

ramsan answers: You will find both, the start and stop commands in:

   File->Debug on

If I use the f11 Step Into command on a source statement that references another file, debugger will start another separate debugging session on the new file rather than incorporate it into the current session. If I use the f10 Step Through command, the sourced file will not be stepped through, but will be incorporated into the current session as I expected the f11 button to work.

ramsan answers: The default way of working (can be changed in preferences), is that a file will only be entered when "stepping into" if it is already loaded into RamDebugger. In this way, a big amount of unnecessary files does not need to be instrumented and loaded. Apart from it, F10 and F11 should work OK

Global variables can't be viewed in the right-hand variables table, even when the "local variables" checkbutton is deselected.

ramsan answers: To deselect the "local variables", means that nothing will be viewed. If you want to see global variables, use:

    Debug->Expressions or
    the Right upper tab (inserting var names there) or
    put the cursor over one variable name in the code

HZe: I really like this one! It really helps finding bugs very easily. But I have two issues. Perhaps someone can help me with that:

First, (on Windows) when debugging and pressing the start/continue button the second time (while my application is already running) it asks whether to start new and I have to answer "no". This is somewhat irritating. But it works and continues debugging the running application.

ramsan: Version 3.2 should avoid this problem. Now, it is necessary to stop debugging before starting again.

Second, I would like to trigger the Debugger by a flag in all my applications. This would usually be done by remote debugging, I guess. But (again on Windows) I don't want to use an additional package (comm) and I want to have it platform-independent. I once did it with TUBA by just letting the application restart itself in the debugger (exec RamDebugger.tcl $argv0 $argv). How can I pass the program name and parameters to RamDebugger? It works, if I manually use "Debug-on" but RamDebugger seems to ignore additional parameters. Of course, before restarting, the flag to invoke the Debugger has to be toggled, so we do not end up in a loop forever.

This scenario is so important to me, because my tcl applications are not started from a shell directly, but are invoked from another system. The application can only work properly, if the environment is set correctly and parameters (mostly names of temporarily created files) are used.

ramsan: Use RamDebugger as a package. Use something like this in your application:

    bind all <F12> {
        # enter here the path where you have installed RamDebugger
        # for example: {c:\Program files\RamDebugger}
        lappend auto_path {C:\TclTk\RamDebugger3.2} {C:\TclTk\ActiveTcl8.4\lib}
        package require RamDebugger
    }

Bryan Oakley 11-11-2003: this doesn't seem to help much. My tcl applications are started via another process, so I thought this sounded like a neat solution. So, I added the above code, started my application, then pressed F12. The debugger starts, but it doesn't seem to be connected to the running app. Color me disappointed.

ramsan: After starting the debugger, choose the file to debug and press Continue/go (F5). The debugger should become connected.

Bryan Oakley That got me a little further, but now I get a dialog saying "Received Error from Debugged program: Already existing channel: :comm::comm Check Output for details". Clicking OK gives me "Received Error... too many nested calls to Tcl_EvalObj".

Remote debugging seems to work, so I'll try it that way instead.


Why oh why did it take me so long to discover this gem? Thanks for creating this terrific tool... -jcw


'Someone have the energy to make a page along the lines of, "RamDebugger Testimonials"? They seem to be piling up here ... Notice that tclguy, himself responsible for a (proprietary) competitor, has written, "RamDebugger is probably your best bet for free GUI debuggers."


RLH - The links on the download page are wrong...


Where is the 'step out' command? I consider a debugger without this facility to be practically unusable.

ramsan - Last RamDebugger version 5.5 has a command called "return" that should do a 'step out'.

ET This seems to do an immediate return, not a step out. A step out, in say visual C, means run but do a breakpoint upon returning from the current level. And similarly, I don't think break does what I would want, to break from the current loop. It seems to just do a step (into).


HZe - it would be nice if there would be a switch to write only spaces, not tabs. I use indent size 4 (which RamDebugger allows to configure: great!) but when saving a file 8 spaces get a tab. I don't want to start a religious discussion about how indent size should be or how wide a tab is, but a switch to force RamDebugger to write always spaces for indentation would be appreciated. Nevertheless: great tool! I like it.

For me, this one does it (not the optimal solution, but a start):

        proc RamDebugger::_savefile_only { file data } {
            variable FileSaveHandlers

            if { $file eq "*Macros*" } {
                SaveMacrosDocument $data
            } elseif { [info exists FileSaveHandlers($file)] } {
                set err [catch {eval $FileSaveHandlers($file) [list $file $data]} errstring]
                if { $err } { error "Error saving file '$file' ($errstring)" }
            } else {
                if { [file exists $file] } {
                    set ic 0
                    while { [file exists $file.~$ic~] } { incr ic }     
                    set renfile $file.~$ic~
                    set err [catch { file rename -force $file $renfile } errstring]
                    if { $err } { error "Error saving file '$file' ($errstring)" }
                }
                set err [catch { open $file w } fout]
                if { $err } { error "Error saving file '$file'" }

                set header [string range $data 0 255]
                if { [regexp -- {-\*-\s*coding:\s*utf-8\s*;\s*-\*-} $header] } {
                    fconfigure $fout -encoding utf-8
                }
                if 0 {
                        # original:
                        puts -nonewline $fout $data
                } else {
                        # new: while saving, convert <tab> to 8 <blanks>
                        foreach line [split $data \n] {
                            while {[regsub {^( *)\t} $line {\1        } line] > 0} {}
                            puts $fout $line
                        }
                }
                close $fout
                if { [info exists renfile] } {
                    file delete -force $renfile
                }
            }
        }

ET I'm running on windows. I'm a bit curious about a few things. I'm running the starkit. I see lots of registry activity and there is now an entry, but nothing seems to be there when looking from regedit, yet it does remember its prefs. I see tclkit.exe has launched cvs.exe, and my zone-alarm pops up wanting to know if cvs.exe can access the internet. Is there some version controlled default repository built into this program? Very odd behavior for what looks to be a rather fantastic program. I don't want to look a gift horse in the mouth, but better safe than sorry...

ramsan The registry is used to save the preferences. cvs is used to maintain a history of changes in the files. Look at menu File->Revisions. Anyway, it is an open source program. You can look at the code to verify this.

ET Ah, I see, cool feature. The ZA log said cvs.exe was trying to get to my router for some DNS lookup. Funny, the cvs.exe that get's invoked is in my cygnus directory. Anyway, no biggy. I just told ZA to prohibit access and it still works ok. This is quite a program.


CRV I'm new -- while trying to follow the tutorial on file example1.tcl it gives a warning dialog that says "Recieved Error from Debugged program {invalid command name "toplevel"} Check Output for details" Reading the output tells me that the first line is the problem (i.e. toplevel .t). Similar things happen on other files -- what am I missing?

MG It's only a guess, but it sounds like you might not have Tk loaded, CRV. Try adding

  package require Tk

somewhere at the top of your code and trying it again?

LV Also, be certain that the tcl that is being used to start the program is one that has Tk available to it. I've seen cases in the past where someone only installs Tcl or a tclkit that only has tcl in it, and thus doesn't have Tk available.


SEH 20060721 -- I just downloaded rdb 5.6 and wanted to run it in text mode via Tkcon. I sourced RamDebugger.tcl, did the namespace import, did rlist -asmainfile on my file, and got the following error:

 invalid command name "RamDebugger::TextOutRaise"
    while executing
 "RamDebugger::TextOutRaise"
    (procedure "rlist" line 209)
    invoked from within
 "rlist -asmainfile globfind.tcl"
    ("uplevel" body line 1)
    invoked from within
 "uplevel #0 {rlist -asmainfile myfile.tcl}"

Update: my file had a missing close brace. Perhaps you should check files for well-formedness before sourcing.


escargo 2 Jan 2008 - I just downloaded the 6.1.2 starkit, and it does run under Microsoft Windows XP SP2. When I bring up the "about" window from the Help menu, it's very animated, but I can't get the window to close. The "Close" button is animated to the point where it tries to run away when you try to point to it. The close button on the window decorations (X) is not honored. When I used the tab key to put the focus on the Close button, it would not honor the return key press to invoke its function. (I did shrink the window to restrict the room the button had to run around with and got a congratulations message when I finally clicked on it. That does demonstrate a perverse sense of humor, I guess.) I think the window's X and the tab-and-return ought to work to close the window.


ube Looks great. Only I had problems on XP: "can't find package snit". I use Tcl/Tk version 8.5. Clicking on those little examples .. they work. Both environment variables are there. - Please, what could be a reason?

srinathk Looks like a good debugger but I am not able to invoke this and getting the same error..

Error in startup script: can't find package snit
    while executing
"package require snit"
    (file "/psc/proj/DesignReUse_SW/prb/TclTK_Ram_Debugger/RamDebugger6.2/./addons/dialogwin/dialogwin.tcl" line 13)
    invoked from within
"source /psc/proj/DesignReUse_SW/prb/TclTK_Ram_Debugger/RamDebugger6.2/./addons/dialogwin/dialogwin.tcl"
    ("package ifneeded" script)
    invoked from within
"package require dialogwin"
    (procedure "RamDebugger::InitGUI" line 54)
    invoked from within
"RamDebugger::InitGUI .gui $geometry $ViewOnlyTextOrAll $topleveluse"
    invoked from within
"if { ![info exists SkipRamDebuggerInit] } {
    if { [info command master] != "" } {
        set registerasremote 0
    } else { set registerasremote 1 }
   ..."
    (file "RamDebugger.tcl" line 8482)

I am using tcl/tk 8.4.7 version Linux. Appreciate your help.

schlenk Reading the error messages helps..., Snit is a package from tcllib, you should probably install it too.

srinathk hi schlenk, thanks for your inputs. I have tried installing snit package and later updated my environment. Now I am able to use RamDebugger. In the first look I found it very useful and am able to debug my application. Thanks a lot Ramsan.