After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 497913 - Add line numbers to Script-fu error messages.
Add line numbers to Script-fu error messages.
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Script-Fu
2.4.x
Other All
: Low enhancement
: Future
Assigned To: GIMP Bugs
GIMP Bugs
: 533955 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-11-18 14:14 UTC by Alexia Death
Modified: 2018-05-24 12:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alexia Death 2007-11-18 14:14:51 UTC
Its a nasty PITA to debug a failing gimp script without a clue at what file region to look...
Comment 1 Michael Natterer 2007-11-18 14:21:46 UTC
It should print the line/column the error was in, perferrably even
quoting the line and pointing out the point of failure.
Comment 2 Kevin Cozens 2007-11-18 20:47:53 UTC
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.
Comment 3 Alexia Death 2007-11-18 22:15:47 UTC
If getting line numbers is difficult displaying a call trace or even just the complete offending expression would help too...
Comment 4 Kevin Cozens 2007-11-19 20:47:46 UTC
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.
Comment 5 Kevin Cozens 2008-05-20 03:07:43 UTC
*** Bug 533955 has been marked as a duplicate of this bug. ***
Comment 6 Sven Neumann 2008-10-06 06:37:33 UTC
I don't think any further information is needed for this bug report. It's pretty clear what it's all about.
Comment 7 LightningIsMyName 2011-02-07 21:31:55 UTC
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)
Comment 8 Kevin Cozens 2011-02-07 21:46:41 UTC
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.
Comment 9 Jehan 2016-08-27 02:13:28 UTC
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? :-)
Comment 10 GNOME Infrastructure Team 2018-05-24 12:15:57 UTC
-- 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.