You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/01/05 21:04:39 UTC

[GitHub] [netbeans] entlicher opened a new pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

entlicher opened a new pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417


   When submitting a breakpoint into a Java native image, we consult the list of source files from the executable to determine the correct destination file.
   
   The breakpoint's file is resolved relative to the `sources` folder, which is expected to be the sibling of the executable file.
   When the `sources` folder is not found, breakpoints are resolved to locations that do not exist in the executable.
   To verify the correctness of file paths, we use a newly introduced `NIDebugger.listSources()` method.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher merged pull request #3417: Native image breakpoints work with shared libraries.

Posted by GitBox <gi...@apache.org>.
entlicher merged pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher merged pull request #3417: Native image breakpoints work with shared libraries.

Posted by GitBox <gi...@apache.org>.
entlicher merged pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#issuecomment-1007368905


   I've just tried a version of the `.vsix` extension prepared by Martin and it kinda works: If my `libxyz.so` is loaded, I can attach, place a breakpoint to it and it is hit!
   
   If I first attach, then load my dynamic library, the breakpoint doesn't work. But I can live with it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#issuecomment-1007785699


   After all I've abandoned matching file paths in the sources listing as we can not have reliable source list for lazily loaded shared libraries.
   The fix reduces to breakpoints submission based on relative paths with respect to the `sources` folder and using `-f` option to create pending breakpoints when the location is unknown.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780561178



##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/api/debug/NIDebugger.java
##########
@@ -257,6 +257,16 @@ public String getVersion() {
         return provider.listVariables(name, includeNondebug, maxResults);
     }
 
+    /**
+     * Get a list of source paths in the debuggee.
+     *
+     * @param nameRegexp regular expression that filters the list of source paths
+     * @since 0.7
+     */
+    @CheckForNull
+    public List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       The API changes were abandoned for now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780561080



##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/spi/debug/NIDebuggerProvider.java
##########
@@ -194,4 +194,13 @@
     default Map<SourceInfo, List<Symbol>> listVariables(String name, boolean includeNondebug, int maxResults) {
         return null;
     }
+
+    /**
+     * Provide a list of source paths in the debuggee.
+     *
+     * @since 0.7
+     */
+    default List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       The API changes were abandoned for now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780560847



##########
File path: java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
##########
@@ -154,6 +159,25 @@ private Breakpoint added(JPDABreakpoint b) {
         return null;
     }
 
+    private String verifyFilePath(String filePath, String relativePath) {
+        if (relativePath != null) {
+            List<SourceInfo> sources = debugger.listSources(SOURCES_FOLDER + File.separator + relativePath);

Review comment:
       Good point.
   After all I've abandoned matching file paths in the sources listing as we can not have reliable source list for lazily loaded shared libraries.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#issuecomment-1007865266


   The newest version seems to work for my use-case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#issuecomment-1007368905






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#issuecomment-1007785699


   After all I've abandoned matching file paths in the sources listing as we can not have reliable source list for lazily loaded shared libraries.
   The fix reduces to breakpoints submission based on relative paths with respect to the `sources` folder and using `-f` option to create pending breakpoints when the location is unknown.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780234682



##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/api/debug/NIDebugger.java
##########
@@ -257,6 +257,16 @@ public String getVersion() {
         return provider.listVariables(name, includeNondebug, maxResults);
     }
 
+    /**
+     * Get a list of source paths in the debuggee.
+     *
+     * @param nameRegexp regular expression that filters the list of source paths
+     * @since 0.7
+     */
+    @CheckForNull
+    public List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       A note in `apichanges.xml` would be good. This method shall never return `null`, rather empty list - unless you want to use `null` for some use-case. In such case mention that in Javadoc.

##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/spi/debug/NIDebuggerProvider.java
##########
@@ -194,4 +194,13 @@
     default Map<SourceInfo, List<Symbol>> listVariables(String name, boolean includeNondebug, int maxResults) {
         return null;
     }
+
+    /**
+     * Provide a list of source paths in the debuggee.
+     *
+     * @since 0.7
+     */
+    default List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       A note in API changes would be good. Specify that the method can return `null`. State the `List` is immutable.

##########
File path: java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
##########
@@ -154,6 +159,25 @@ private Breakpoint added(JPDABreakpoint b) {
         return null;
     }
 
+    private String verifyFilePath(String filePath, String relativePath) {
+        if (relativePath != null) {
+            List<SourceInfo> sources = debugger.listSources(SOURCES_FOLDER + File.separator + relativePath);

Review comment:
       `listSources` is supposed to take RegExp - what will it do on Windows? `\` is an escape character...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] entlicher commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
entlicher commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780560847



##########
File path: java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
##########
@@ -154,6 +159,25 @@ private Breakpoint added(JPDABreakpoint b) {
         return null;
     }
 
+    private String verifyFilePath(String filePath, String relativePath) {
+        if (relativePath != null) {
+            List<SourceInfo> sources = debugger.listSources(SOURCES_FOLDER + File.separator + relativePath);

Review comment:
       Good point.
   After all I've abandoned matching file paths in the sources listing as we can not have reliable source list for lazily loaded shared libraries.

##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/spi/debug/NIDebuggerProvider.java
##########
@@ -194,4 +194,13 @@
     default Map<SourceInfo, List<Symbol>> listVariables(String name, boolean includeNondebug, int maxResults) {
         return null;
     }
+
+    /**
+     * Provide a list of source paths in the debuggee.
+     *
+     * @since 0.7
+     */
+    default List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       The API changes were abandoned for now.

##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/api/debug/NIDebugger.java
##########
@@ -257,6 +257,16 @@ public String getVersion() {
         return provider.listVariables(name, includeNondebug, maxResults);
     }
 
+    /**
+     * Get a list of source paths in the debuggee.
+     *
+     * @param nameRegexp regular expression that filters the list of source paths
+     * @since 0.7
+     */
+    @CheckForNull
+    public List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       The API changes were abandoned for now.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #3417: Consult the list of sources when submitting native breakpoints in Java native image.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #3417:
URL: https://github.com/apache/netbeans/pull/3417#discussion_r780234682



##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/api/debug/NIDebugger.java
##########
@@ -257,6 +257,16 @@ public String getVersion() {
         return provider.listVariables(name, includeNondebug, maxResults);
     }
 
+    /**
+     * Get a list of source paths in the debuggee.
+     *
+     * @param nameRegexp regular expression that filters the list of source paths
+     * @since 0.7
+     */
+    @CheckForNull
+    public List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       A note in `apichanges.xml` would be good. This method shall never return `null`, rather empty list - unless you want to use `null` for some use-case. In such case mention that in Javadoc.

##########
File path: ide/nativeimage.api/src/org/netbeans/modules/nativeimage/spi/debug/NIDebuggerProvider.java
##########
@@ -194,4 +194,13 @@
     default Map<SourceInfo, List<Symbol>> listVariables(String name, boolean includeNondebug, int maxResults) {
         return null;
     }
+
+    /**
+     * Provide a list of source paths in the debuggee.
+     *
+     * @since 0.7
+     */
+    default List<SourceInfo> listSources(String nameRegexp) {

Review comment:
       A note in API changes would be good. Specify that the method can return `null`. State the `List` is immutable.

##########
File path: java/java.nativeimage.debugger/src/org/netbeans/modules/java/nativeimage/debugger/breakpoints/JPDABreakpointsHandler.java
##########
@@ -154,6 +159,25 @@ private Breakpoint added(JPDABreakpoint b) {
         return null;
     }
 
+    private String verifyFilePath(String filePath, String relativePath) {
+        if (relativePath != null) {
+            List<SourceInfo> sources = debugger.listSources(SOURCES_FOLDER + File.separator + relativePath);

Review comment:
       `listSources` is supposed to take RegExp - what will it do on Windows? `\` is an escape character...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists