[feature] Errors with line numbers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[feature] Errors with line numbers

ZuLuuuuuu
Issue status update for
http://smalltalk.gnu.org/node/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   ZuLuuuuuu
 Status:       active

It would be very helpful if all the errors while interpreting were
represented with line numbers.

For example, consider a simple script with a "MessageNotUnderstood"
error:

| foo |
foo := 5, 'bar'

The virtual machine gives an error like this:

Object: 2 error: did not understand #,
MessageNotUnderstood(Exception)>>signal
SmallInteger(Object)>>doesNotUnderstand: #,
UndefinedObject>>executeStatements

The error is explanatory except that it does not say at exactly which
line the error happened. This makes it difficult to specify where the
error is especially if the source code is composed of hundreds of
lines.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Errors with line numbers

Paolo Bonzini-3
Issue status update for
http://smalltalk.gnu.org/project/issue/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   bonzinip
-Status:       active
+Status:       fixed

After commit c221537 this is produced.  If you want a better format,
just reply to this message with suggestion (note: it's *not* currently
possible to have absolute line numbers, i.e. relative to the file and
not the method).

Object: nil error: abc
Error(Exception)>>signal (line 6)
Error(Exception)>>signal: (line 8)
UndefinedObject(Object)>>error: (line 7)
optimized [] in UndefinedObject>>executeStatements (line 2)
UndefinedObject>>executeStatements (line 2)




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Errors with line numbers

ZuLuuuuuu
In reply to this post by ZuLuuuuuu
Issue status update for
http://smalltalk.gnu.org/project/issue/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   ZuLuuuuuu
 Status:       fixed

I couldn't test it yet, the new master branch build wants makeinfo
package but I couldn't find a .deb for it yet. There is a texi2html
package instead of it. Is there a way to have the make command use it
instead of makeinfo?




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Errors with line numbers

ZuLuuuuuu
In reply to this post by ZuLuuuuuu
Issue status update for
http://smalltalk.gnu.org/project/issue/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   ZuLuuuuuu
 Status:       fixed

I tested it with a few of my relatively long .st files but I cannot say
that it is much useful. That's even more confusing I guess because I
couldn't solve what the line numbers represent yet :D

I guess absolute line numbers relative to the beginning of the file is
what I am seeking for, like in Python or Ruby (Tcl is also not that
successful, I think). A line number which leads me directly to the
erroneous line. The format is good though...




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Canol Gökel
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Errors with line numbers

Paolo Bonzini-3
In reply to this post by ZuLuuuuuu
Issue status update for
http://smalltalk.gnu.org/project/issue/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   bonzinip
 Status:       fixed

> I tested it with a few of my relatively long .st files but I cannot
say
> that it is much useful. That's even more confusing I guess because I
> couldn't solve what the line numbers represent yet :D

It's a line number relative to the beginning of the current method.
Absolute line numbers currently are not stored in the methods, though I
guess I could special case the very first line-number bytecode to store
the first line number (instead of 1) and use that as a delta.  The
browser could ignore it instead.

> I guess absolute line numbers relative to the beginning of the file
is
> what I am seeking for, like in Python or Ruby (Tcl is also not that
> successful, I think). A line number which leads me directly to the
> erroneous line. The format is good though...




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [feature] Errors with line numbers

Paolo Bonzini-3
In reply to this post by ZuLuuuuuu
Issue status update for
http://smalltalk.gnu.org/project/issue/233
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/233

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    VM
 Category:     feature requests
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  ZuLuuuuuu
 Updated by:   bonzinip
 Status:       fixed

Ok, these three commits implement it:

e7fa6bc1a81f52a80fa8bb16cbf43a0d26f4b3df print the filename in
backtraces too
dcd363184824ac9a01aacf28d77fcdfe122e4eb2 add
FilePath>>#isFileSystemPath
f848ffe062b600326ed61a1bdb55322c9fdc9f0b print file-based line numbers
in backtraces

The result is:

st> #(1) at: 2
Object: Array new: 1 "<0x3038628>" error: Invalid index 2: index out of
range
SystemExceptions.IndexOutOfRange(Exception)>>signal (AnsiExcept.st:216)
SystemExceptions.IndexOutOfRange class>>signalOn:withIndex:
(AnsiExcept.st:804)
Array(Object)>>checkIndexableBounds: (Object.st:782)
Array(Object)>>at: (Object.st:842)
UndefinedObject>>executeStatements (a String:1)

/a String/ means stdin in this case.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk