GNOME Bugzilla – Bug 497913
Add line numbers to Script-fu error messages.
Last modified: 2018-05-24 12:15:57 UTC
Its a nasty PITA to debug a failing gimp script without a clue at what file region to look...
It should print the line/column the error was in, perferrably even quoting the line and pointing out the point of failure.
It used to be a PITA to debug Script-Fu scripts. It is a lot easier with the introduction of the TinyScheme based Script-Fu plug-in. Use the GUI console, or start GIMP from a console with the "-b -" options, and turning tracing on/off with '(tracing 1)' and '(tracing 0)'. Be careful where you put these as it can affect return values from a function. I will write up notes about debugging Script-Fu scripts at a later date for my Script-Fu/Tiny-Fu wiki. Displaying line/column information when a script is loaded would not be that difficult. Displaying the same information during the running of a script is non-trivial. The load process "tokenizes" the input file in to a collection of data cells. Each data cell would need to record the line/column values at the time the cells were created in order to have any meaningful information. Also, with the namespace issues, line/column information is not useful since the error might be in a different script than the one invoked. This issue has come up before. It isn't likely to get done anytime soon. I highly doubt it will be done before 2.6 is released. Setting the milestone to Future.
If getting line numbers is difficult displaying a call trace or even just the complete offending expression would help too...
A call trace, like the one I mentioned in the first paragraph of comment #2, is helpful in debugging. You will find it can give you way more information that you need. It is a new feature in Script-Fu due to the switch to TinyScheme.
*** Bug 533955 has been marked as a duplicate of this bug. ***
I don't think any further information is needed for this bug report. It's pretty clear what it's all about.
Fixed in master, closing as fixed 526c42dc3565ce1c0a7bc6914e614fa6ac6ea01d Mon Sep 17 00:00:00 2001 From: Kevin Cozens <kcozens@cvs.gnome.org> Date: Mon, 07 Feb 2011 08:30:13 +0000 Optionally report error line (from SVN r63 of official TinyScheme)
Re-opening this report. The commit that added line number reporting in TinyScheme is not enabled by default and has not been tested with Script-Fu. I need to determine how much extra overhead this adds to GIMP startup and whether it will give the right line number when an error occurs in an included file.
Hello Kevin, What's happening with this patch? I can see the code is still there in master, and it looks enabled to me (SHOW_ERROR_LINE defined to 1). Has it been fully tested by now? Does it give the right line number? What about the overhead? Basically what about all the things you wanted to test years ago? :-)
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/255.