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

JDI TestScaffold does not support passing app arguments to the debuggee

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 21
    • core-svc
    • b25

      There seems to be some support for application args in parseArgs():

                  if (classNameParsed) {
                      // once classname is read, treat any other arguments as app arguments
                      argInfo.targetAppCommandLine += (arg + ' ');
                      continue;
                  }

      But before we get to parseArgs(), we have startup() adding the debuggee class name last.

          protected void startUp(String targetName) {
              List<String> argList = new ArrayList(Arrays.asList(args));
              argList.add(targetName);
              println("run args: " + argList);
              connect(argList.toArray(args));
              waitForVMStart();
          }

      It's assuming args[] only contains VM arguments. So that means what is suppose to be the first application argument ends up being taken as the class name by parseArgs(). I think startUp() needs to do something similar to parseArgs() and find the first argument that doesn't start with a '-', and insert targetName at that point.

      I need this support for a new test case I am writing for JDK-8308237.

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: