Debugger showing incorrect line numbers [message #202044] |
Tue, 26 April 2005 20:51 |
Eclipse User |
|
|
|
Originally posted by: andrew.kuttig.embarcadero.com
I'm using ANTLR (antlr.org) to generate a parser in Java. The generated
..java file is almost 100K lines long. When I try to debug the file, any
lines past 65535 are not working. The debugger incorrectly reports the line
as 65536 lines earlier. For example, if I step into a method that appears on
line 80460, the debugger stops on line 14924. All debugging functions work
correctly, except the debugger is reporting and highlighting the wrong line,
which makes debugging near impossible.
Obviously the debugger is using a 16-bit integer to represent the line
numbers. Does anyone know how to fix it?
|
|
|
Re: Debugger showing incorrect line numbers [message #202061 is a reply to message #202044] |
Tue, 26 April 2005 22:24 |
Eclipse User |
|
|
|
Originally posted by: jaredburns.no.spam.acm.org
The debugger just uses the ints (32-bit) that are returned from the VM
over the wire
( http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp/jdwp-pro tocol.html#JDWP_Method_LineTable).
These ints come from the line numbers that are put in the classfile by
the compiler. Have you double-checked that your debug attributes are
being set correctly in the classfiles?
- Jared
Andrew Kuttig wrote:
> I'm using ANTLR (antlr.org) to generate a parser in Java. The generated
> .java file is almost 100K lines long. When I try to debug the file, any
> lines past 65535 are not working. The debugger incorrectly reports the line
> as 65536 lines earlier. For example, if I step into a method that appears on
> line 80460, the debugger stops on line 14924. All debugging functions work
> correctly, except the debugger is reporting and highlighting the wrong line,
> which makes debugging near impossible.
>
> Obviously the debugger is using a 16-bit integer to represent the line
> numbers. Does anyone know how to fix it?
>
>
|
|
|
Re: Debugger showing incorrect line numbers [message #202075 is a reply to message #202044] |
Wed, 27 April 2005 14:56 |
Eclipse User |
|
|
|
Originally posted by: andrew.kuttig.embarcadero.com
After some investigation, it appears as though the field in the classfile
that contains the line numbers is only 2 bytes. This is a Java limitation,
I'm surprised the compiler doesn't generate a warning when you compile files
this large.
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Class File.doc.html#22856
"Andrew Kuttig" <andrew.kuttig@embarcadero.com> wrote in message
news:d4m9r1$qss$1@news.eclipse.org...
> I'm using ANTLR (antlr.org) to generate a parser in Java. The generated
> .java file is almost 100K lines long. When I try to debug the file, any
> lines past 65535 are not working. The debugger incorrectly reports the
> line as 65536 lines earlier. For example, if I step into a method that
> appears on line 80460, the debugger stops on line 14924. All debugging
> functions work correctly, except the debugger is reporting and
> highlighting the wrong line, which makes debugging near impossible.
>
> Obviously the debugger is using a 16-bit integer to represent the line
> numbers. Does anyone know how to fix it?
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03469 seconds