Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296445

C++ syntax error in jdwpTransport.h

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 20
    • 11, 17, 20
    • core-svc
    • None
    • b23
    • 10
    • b23

      Reported by <1052156701@qq.com>

      Bug description
      The code in jdwpTransport.h has syntax error.
      For example, use `g++ -c jdwpTransport.h` to compile it, this error message will be produced:
      -----------------------------------------------------------------------
      jdwpTransport.h:266:9: error: expected identifier before 'return'
               return functions->SetTransportConfiguration(this, config);
               ^~~~~~
      jdwpTransport.h:266:9: error: expected ',' or '...' before 'return'
      jdwpTransport.h:266:66: error: expected ')' before ';' token
               return functions->SetTransportConfiguration(this, config);
                                                                        ^
      jdwpTransport.h:267:5: error: expected ';' after struct definition
           }
           ^
      jdwpTransport.h:273:1: error: expected declaration before '}' token
       } /* extern "C" */
       ^
      ------------------------------------------------------------------------

      Bug fix
      The bug is caused by the wrong signature of method `SetTransportConfiguration(jdwpTransportEnv* env,`.
      So, I correct the method signature to `SetTransportConfiguration(jdwpTransportConfiguration *config)`.

      Git diff
      -------------------------------------------------------------------
      diff --git a/src/jdk.jdwp.agent/share/native/include/jdwpTransport.h b/src/jdk.jdwp.agent/share/native/include/jdwpTransport.h
      index cdbd04d429c..642d167a230 100644
      --- a/src/jdk.jdwp.agent/share/native/include/jdwpTransport.h
      +++ b/src/jdk.jdwp.agent/share/native/include/jdwpTransport.h
      @@ -262,7 +262,7 @@ struct _jdwpTransportEnv {
           }

           /* SetTransportConfiguration added in JDWPTRANSPORT_VERSION_1_1 */
      - jdwpTransportError SetTransportConfiguration(jdwpTransportEnv* env,
      + jdwpTransportError SetTransportConfiguration(jdwpTransportConfiguration *config) {
               return functions->SetTransportConfiguration(this, config);
           }
      ----------------------------------------------------------------------

            dholmes David Holmes
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: