Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Debugger showing incorrect line numbers
Debugger showing incorrect line numbers [message #202044] Tue, 26 April 2005 20:51 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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?
>
Re: Debugger showing incorrect line numbers [message #202100 is a reply to message #202075] Wed, 27 April 2005 20:54 Go to previous message
Jim Adams is currently offline Jim AdamsFriend
Messages: 160
Registered: July 2009
Senior Member
I thought javac did generate an error. We chanced upon this a long time
ago I think with JSP files. I think we were able to get Javasoft to
address this issue.

Andrew Kuttig wrote:
> 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?
>>
>
>
>
Previous Topic:Nested For Looy
Next Topic:Help with Sunshine Reports
Goto Forum:
  


Current Time: Tue Jan 28 14:59:05 GMT 2025

Powered by FUDForum. Page generated in 0.03469 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top