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.

Bug 189684 - Cursor jumps on old lines (file is modified) if DTrace provider is selected
Summary: Cursor jumps on old lines (file is modified) if DTrace provider is selected
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Profile (show other bugs)
Version: 7.0
Hardware: PC Solaris
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-19 14:52 UTC by soldatov
Modified: 2010-10-15 02:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (68.43 KB, image/png)
2010-10-11 12:54 UTC, soldatov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2010-08-19 14:52:52 UTC
Scenario:
- Add some Solaris remote host
- Create CppApplication project with main.cpp file
- Select Solaris remote host
- Select "Dtrace" profiler
- Add such code:

#include <cstdlib>
#include <unistd.h>
#include <cstdio>

using namespace std;

int f(unsigned long n) {
    for (int i = 2; i <= n / 2; i++) {
        if ((n % i) == 0) {
            printf("%d\n", i);
            return i;
        }
    }
    return 1;
}

int main(int argc, char** argv) {
    f(2147483647);

    return 0;
}

- Build and run
- Press on "Hot Spots..." button
- Check "Go to Source" for 'f' and 'main'
==> ok
- Add 2-3 empty lines before "int f()"
- run again
- Press on "Hot Spots..." button again
- Check "Go to Source" for 'f' and 'main'
==> cursor jumps on old lines
Comment 1 soldatov 2010-10-11 12:40:42 UTC
I can reproduce this problem on local Solaris machine also.
Comment 2 soldatov 2010-10-11 12:53:41 UTC
Local scenario:
- Create CppApplication project with main.cpp file
- Select "Dtrace" profiler
- Add such code:
/* 
 * File:   main.cpp
 * Author: tester
 *
 * Created on October 11, 2010, 4:35 PM
 */

#include <cstdlib>
#include <unistd.h>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    for (int i = 0; i < 10; i++) {
        sleep(1);
    }
    return 0;
}

- Build and run
- Press on "Hot Spots..." button
- Check "Go to Source" for 'main at main.cpp:17'
==> cursor jumps on 17th line
- Delete all comments:

#include <cstdlib>
#include <unistd.h>

using namespace std;

int main(int argc, char** argv) {
    for (int i = 0; i < 10; i++) {
        sleep(1);
    }
    return 0;
}

- Rebuild and rerun project
- Press on "Hot Spots..." button
==> I see 'main at main.cpp:17' line in table, but file contains 14 lines only
Comment 3 soldatov 2010-10-11 12:54:25 UTC
Created attachment 102351 [details]
screenshot
Comment 4 Maria Tishkova 2010-10-13 11:35:31 UTC
Sasha, 

please use UNIQUE key to cache functions list for the executable.
Comment 5 Alexander Simon 2010-10-14 14:39:36 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/bb58362b11df
Comment 6 Quality Engineering 2010-10-15 02:54:20 UTC
Integrated into 'main-golden', will be available in build *201010150000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/bb58362b11df
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #189684 Cursor jumps on old lines (file is modified) if DTrace provider is selected