RFR - JDK-8218650: LineNumberTable records for method invocations with arguments

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Feb 21 23:37:32 UTC 2019


On 21/02/2019 19:27, Liam Miller-Cushon wrote:
> For what it's worth I filed JDK-8218650 after a real debugging session 
> where I spent a while trying to understand an 'impossible' NPE before 
> realizing it was actually happening on the next line. So anecdotally 
> at leave one moderately savvy consumer of debug info would have 
> benefited from the extra LNT entries :)
>
> The approach in JDK-8218628 sounds very promising, though. That 
> information would have been sufficient in the example that motivated 
> JDK-8218650.
>
> > e.g. access to fields in different classes with same name :-)
>
> Won't that be an issue even if javac starts emitting LNT entries for 
> field accesses *and* the NPE messages get more detailed?
>
> i.e. you could also have `b.b.b` and even if we know the line and that 
> `b` was involved it's ambiguous which dereference failed. (If the NPE 
> message included a qualified name of `b` that would be sufficient 
> except for some really pathological cases.)
>
Yes - in that case not much can be done - unless we add column info too :-)
> Another option for improving the message for `b.b.b` would be to 
> include a column number, which was discussed in JDK-8020204.

Ah :-)

Maurizio

>
> On Thu, Feb 21, 2019 at 10:59 AM Maurizio Cimadamore 
> <maurizio.cimadamore at oracle.com 
> <mailto:maurizio.cimadamore at oracle.com>> wrote:
>
>     Yeah - I was afraid that will be the case.
>
>     And I'm wondering what happens in cases where you have stuff like
>
>     b.
>        b.
>           b.
>
>     e.g. access to fields in different classes with same name :-)
>
>     Of course a corner case, but...
>
>     Maurizio
>
>
>     On 21/02/2019 17:38, Vicente Romero wrote:
>     > but it still refers to line 13, so it doesn't seem like it will
>     > produce an exact reference to the actual line where the NPE happened
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20190221/2bab4c38/attachment.html>


More information about the compiler-dev mailing list