The test is looking at a specific set
of locals. I don't think having extra locals is really a concern,
but a return statement should also work as well.
Yes, hard coded line numbers have been a problem many times in the
past. Usually it's changes to the copyright template that bite us.
It would probably be best to file a bug and list the tests that
need to be fixed rather than addressing the particular test at
this time.
Chris
On 9/12/18 9:15 AM, JC Beyler wrote:
Hi Gary,
Just a remark that by replacing the first print command
with a int x = 3; you are changing the test by adding a local.
It does not matter because we are testing other variables, but
we could add a line in the LOCALS table for x for
completeness.
Or we could just put an explicit return with the breakpoint
comment, and the breakpoint will keep the tests consistent?
(note: as a side story, this test is using explicit line
numbers for the breakpoints but I've seen Alex add a lot of
infrastructure to have an automatic parsing system to make it
less error prone, we should update this test at some point).
Just my 2 cents :-),
Jc
The print
statements in the locals002 test have been observed to
interfere
with the output from commands, replies and prompts used in the
synchronization
of operations between the debugger and debuggee. This change
will remove
the
print statements. A follow up bug will be filed for longer
term
investigation of the
character at a time output which leaves a larger window for
the output
interruption
that occurs.
Issue: https://bugs.openjdk.java.net/browse/JDK-8208468
Proposed update:
diff --git
a/test/hotspot/jtreg/vmTestbase/nsk/jdb/locals/locals002/locals002a.java
b/test/hotspot/jtreg/vmTestbase/nsk/jdb/locals/locals002/locals002a.java
---
a/test/hotspot/jtreg/vmTestbase/nsk/jdb/locals/locals002/locals002a.java
+++
b/test/hotspot/jtreg/vmTestbase/nsk/jdb/locals/locals002/locals002a.java
@@ -81,7 +81,7 @@
int[] arrVar
)
{
- System.out.println("Arguments but no locals"); //
locals002.BREAKPOINT_LINE1
+ int x = 3; // locals002.BREAKPOINT_LINE1
}
static void allKindsOfLocals() {
@@ -97,6 +97,6 @@
int[] arrVar = new int[5];
for (int j = 0; j < 5 ; j++) arrVar[j] = j;
- System.out.println("Locals but no arguments"); //
locals002.BREAKPOINT_LINE2
+ int x = 4; // locals002.BREAKPOINT_LINE2
}
}
--
|