This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Incorrect annotation marks | ||
---|---|---|---|
Product: | editor | Reporter: | Alexander Pepin <apepin> |
Component: | Hints & Annotations | Assignee: | Jan Lahoda <jlahoda> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | gorrus, jiriprox, mmirilovic |
Priority: | P2 | Keywords: | REGRESSION |
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | proposed patch |
Description
Alexander Pepin
2011-12-01 13:26:09 UTC
in 7.0.1 patch 2 it works nicely. gdb log for 7.0.1: ~"GNU gdb 6.8.0.20080328-cvs (cygwin-special)\n" ~"Copyright (C) 2008 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n" ~"This is free software: you are free to change and redistribute it.\n" ~"There is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\n" ~"and \"show warranty\" for details.\n" ~"This GDB was configured as \"i686-pc-cygwin\".\n" &"C:\\\\Users\\\\ap153252/.gdbinit: No such file or directory.\n" (gdb) 2-list-features 3-gdb-set print repeat 0 4-gdb-set backtrace limit 1024 5-gdb-set print elements 0 6-file-symbol-file "C:/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/dist/Debug/Cygwin_4.x-Windows/welcome_xxx" 7-file-exec-and-symbols "C:\\Users\\ap153252\\Documents\\NetBeansProjects\\Welcome_xxx\\dist\\Debug\\Cygwin_4.x-Windows\\welcome_xxx" 2^done,features=["frozen-varobjs","pending-breakpoints"] (gdb) 3^done (gdb) 4^done (gdb) 5^done (gdb) 6^done (gdb) 7^done (gdb) 8-file-list-exec-source-file 9cd C:\Users\ap153252\Documents\NetBeansProjects\Welcome_xxx 10-exec-arguments "arg 1" "arg 2" "arg 3" "arg 4" 11set environment Path=C:\cygwin\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.6.0_21\bin\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\cygwin\bin;C:\Program Files (x86)\Calibre2\ 8^done,line="24",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",macro-info="0" (gdb) 12-break-insert -f "C:/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc:38" 1 13-break-insert -f "C:/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc:45" 1 14-break-insert -t main 15-exec-run 16info threads &"cd C:\\Users\\ap153252\\Documents\\NetBeansProjects\\Welcome_xxx\n" ~"Working directory /cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx.\n" 9^done (gdb) 10^done (gdb) &"set environment Path=C:\\cygwin\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Java\\jdk1.6.0_21\\bin\\;C:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\cygwin\\bin;C:\\Program Files (x86)\\Calibre2\\\n" 11^done (gdb) 12^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401254",func="main",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="38",times="0"} (gdb) &"\n" 1^done (gdb) 13^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x004012f8",func="main",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="45",times="0"} (gdb) &"\n" 1^done (gdb) 14^done,bkpt={number="3",type="breakpoint",disp="del",enabled="y",addr="0x0040122b",func="main",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="33",times="0"} (gdb) 15^running (gdb) ~"[New thread 4768.0xf54]\n" &"Error: dll starting at 0x76aa0000 not found.\n" &"Error: dll starting at 0x74a60000 not found.\n" &"Error: dll starting at 0x76aa0000 not found.\n" &"Error: dll starting at 0x76bc0000 not found.\n" No command for record 1^done No command for record 1^done ~"[New thread 4768.0x10c8]\n" 15*stopped,thread-id="1",frame={addr="0x0040122b",func="main",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}],file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="33"} (gdb) &"info threads\n" ~" 2 thread 4768.0x10c8 0x76ebf8f5 in ntdll!RtlUpdateClonedSRWLock ()\n" ~" from /cygdrive/c/Windows/system32/ntdll.dll\n" 17-stack-list-frames ~"* 1 thread 4768.0xf54 main (argc=5, argv=0xb59560) at welcome.cc:33\n" 16^done (gdb) 17^done,stack=[frame={level="0",addr="0x0040122b",func="main",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="33"}] (gdb) 18-stack-list-arguments 1 18^done,stack-args=[frame={level="0",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}]}] (gdb) 19-exec-next 19^running (gdb) 19*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x00401230",func="main",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}],file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="35"} (gdb) 20-stack-list-frames 20^done,stack=[frame={level="0",addr="0x00401230",func="main",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="35"}] (gdb) 21-stack-list-arguments 1 21^done,stack-args=[frame={level="0",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}]}] (gdb) 22-exec-next 22^running (gdb) 22*stopped,reason="end-stepping-range",reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x00401254",func="_fu0___ZSt4cout",args=[],file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="38"} (gdb) 23-stack-list-frames 23^done,stack=[frame={level="0",addr="0x00401254",func="_fu0___ZSt4cout",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="38"}] (gdb) 24-stack-list-arguments 1 24^done,stack-args=[frame={level="0",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}]}] (gdb) 25-exec-next 25^running (gdb) 25*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x00401260",func="_fu0___ZSt4cout",args=[],file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="39"} (gdb) 26-stack-list-frames 26^done,stack=[frame={level="0",addr="0x00401260",func="_fu0___ZSt4cout",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="39"}] (gdb) 27-stack-list-arguments 1 27^done,stack-args=[frame={level="0",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}]}] (gdb) 28-exec-next 28^running (gdb) 28*stopped,reason="end-stepping-range",thread-id="1",frame={addr="0x00401294",func="_fu1___ZSt4cout",args=[],file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="40"} (gdb) 29-stack-list-frames 29^done,stack=[frame={level="0",addr="0x00401294",func="_fu1___ZSt4cout",file="welcome.cc",fullname="/cygdrive/c/Users/ap153252/Documents/NetBeansProjects/Welcome_xxx/welcome.cc",line="40"}] (gdb) 30-stack-list-arguments 1 30^done,stack-args=[frame={level="0",args=[{name="argc",value="5"},{name="argv",value="0xb59560"}]}] (gdb) looks like a race condition in current line annotation setting cnd sets correct line for the current PC annotation but for some reason annotation sticks to the nearest following annotation in the editor (in our case - breakpoint). Interesting observations: 1. if user remove breakpoint annotation or reopen the file - it all reappears correctly (i.e. all annotations appears where they should) 2. it all happen only if before the step current PC annotation was on the same line as another breakpoint annotation (visible mixed annotation) It all worked in 7.0.1, could it be a change in editor that causes this behavior? it looks like this performance optimization is the cause (Annotations.java:401): ... else if (lastGetLineAnnotationsLine + 1 == line && lastGetLineAnnotationsIdx + 1 < lineAnnotationsArray.size()) { annos = (LineAnnotations)lineAnnotationsArray.get(lastGetLineAnnotationsIdx + 1); lastGetLineAnnotationsIdx++; lastGetLineAnnotationsLine = annos.getLine(); lastGetLineAnnotationsResult = annos; return annos; } if I comment these lines everything works perfect Created attachment 113717 [details]
proposed patch
Thanks for the patch. I did the change for getLineAnnotations (only tried to make the diff smaller). For getNextLineWithAnnotation, the current behavior is actually correct: the method should return the line number of a next line with annotations. Which, as I read the code, is exactly what happens. http://hg.netbeans.org/jet-main/rev/337b947a2692 Marian, Jirka, please let me know if this should go to 7.1. (In reply to comment #7) > Marian, Jirka, please let me know if this should go to 7.1. Alexander, or anybody from CND : is it stopper for you (and the only reason to rebuild FCS) ? My personal preference is to fix it into patch (means 7.1.1). cnd QA thinks it is a showstopper (and a regression) and must be fixed in 7.1 The patch seems ok to me. Ok, integrate into release71, ASAP please. release71: http://hg.netbeans.org/releases/rev/a03ccf7e25a4 Please verify. Integrated into 'releases' Changeset: http://hg.netbeans.org/releases/rev/a03ccf7e25a4 User: Jan Lahoda <jlahoda@netbeans.org> Log: #205774: make sure that the last cache is used in getLineAnnotations only if the next annotation's line actually matches the provided line. Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/337b947a2692 User: Jan Lahoda <jlahoda@netbeans.org> Log: #205774: make sure that the last cache is used in getLineAnnotations only if the next annotation's line actually matches the provided line. Verified in FCS build 20111203 |