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 269831 - Debugger cant hit breakpoints in mixed development
Summary: Debugger cant hit breakpoints in mixed development
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Mixed Development (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 03:45 UTC by jcbritobr
Modified: 2017-03-31 18:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jcbritobr 2017-02-15 03:45:23 UTC
Debugger (gdb, mingw, msys2) using mixed development in netbeans is not hiting breakpoints in c/c++ code.

When i go to debug a native method, a message like :

Can not find native process using grep by .*java.+:-1.*

Inside ClassLoder.class, in findNative method, the variable libs has this message:

Variable information is not available, source compiled without -g option. Value of "libs" is not known.

the code about:

package nativemessager;

/**
 *
 * @author Julio
 */
public class NativeMessager {
    
    private native String getLine(String message);
    static{
        System.loadLibrary("libgetline");
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println(new NativeMessager().getLine("this is a jni message."));
    }
    
} 



native code:

#include <iostream>
#include "NativeMessager.h"

jstring JNICALL Java_nativemessager_NativeMessager_getLine
  (JNIEnv * env, jobject object, jstring message) {    
    
    const char* str;
    str = env->GetStringUTFChars(message, NULL);
    env->ReleaseStringUTFChars(message, str);
    
    std::cout << str << std::endl;
    
    return message;
    
}
Comment 1 soldatov 2017-03-14 11:11:56 UTC
I see same bug on my MSYS2 machine (Windows 8.1).
Comment 2 petrk 2017-03-31 18:20:53 UTC
Most likely this will be fixed in next release. As far as I remember we had difficulties on Windows. I would recommend you to try cygwin, by the way. But I'm not sure if it'll work :(